Source File
ordinals.go
Belonging Package
github.com/dustin/go-humanize
package humanizeimport// Ordinal gives you the input number in a rank/ordinal format.//// Ordinal(3) -> 3rdfunc ( int) string {:= "th"switch % 10 {case 1:if %100 != 11 {= "st"}case 2:if %100 != 12 {= "nd"}case 3:if %100 != 13 {= "rd"}}return strconv.Itoa() +}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |