Fix ranking in 3315b63

pull/785/head
Unihedron 2015-08-15 21:26:22 +08:00
parent 554d135d7e
commit 22924a95d5
1 changed files with 3 additions and 1 deletions

View File

@ -22,7 +22,9 @@ trait NumberHelper { self: I18nHelper =>
def localize(implicit ctx: UserContext): String = formatter format number
}
def nth(number: Int) = number match {
def nth(number: Int) = if ((11 to 13).contains(number))
"th"
else number % 10 match {
case 1 => "st"
case 2 => "nd"
case 3 => "rd"