mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 14:07:20 +00:00
Prettify number of issues (#17760)
* Prettify number of issues - Use the PrettyNumber function to add commas in large amount of issues. * Use client-side formatting * prettify on both server and client * remove unused i18n entries * handle more cases, support other int types in PrettyNumber * specify locale to avoid issues with node default locale * remove superfluos argument * introduce template helper, octicon tweaks, js refactor * Update modules/templates/helper.go * Apply some suggestions. * Add comment * Update templates/user/dashboard/issues.tmpl Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -24,6 +24,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
)
|
||||
@ -143,9 +144,9 @@ func FileSize(s int64) string {
|
||||
}
|
||||
|
||||
// PrettyNumber produces a string form of the given number in base 10 with
|
||||
// commas after every three orders of magnitud
|
||||
func PrettyNumber(v int64) string {
|
||||
return humanize.Comma(v)
|
||||
// commas after every three orders of magnitude
|
||||
func PrettyNumber(i interface{}) string {
|
||||
return humanize.Comma(util.NumberIntoInt64(i))
|
||||
}
|
||||
|
||||
// Subtract deals with subtraction of all types of number.
|
||||
|
Reference in New Issue
Block a user