go-ord/en/suffix.go

29 lines
266 B
Go
Raw Normal View History

2023-03-01 17:46:25 +00:00
package orden
func suffixInt64(n int64) string {
{
d := n % 100
switch d {
case 11, 12, 13:
return "th"
}
}
{
d := n % 10
switch d {
case 1:
return "st"
case 2:
return "nd"
case 3:
return "rd"
default:
return "th"
}
}
}