1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-24 18:38:28 +00:00

Show download count info in release list (#10124)

* Show download count info in release list

* Use go-humanize
This commit is contained in:
Lauris BH
2020-02-03 21:50:37 +02:00
committed by GitHub
parent ea50f60df2
commit 20c513be6e
23 changed files with 1207 additions and 40 deletions

25
vendor/github.com/dustin/go-humanize/ordinals.go generated vendored Normal file
View File

@@ -0,0 +1,25 @@
package humanize
import "strconv"
// Ordinal gives you the input number in a rank/ordinal format.
//
// Ordinal(3) -> 3rd
func Ordinal(x int) string {
suffix := "th"
switch x % 10 {
case 1:
if x%100 != 11 {
suffix = "st"
}
case 2:
if x%100 != 12 {
suffix = "nd"
}
case 3:
if x%100 != 13 {
suffix = "rd"
}
}
return strconv.Itoa(x) + suffix
}