Is there a localized way to show truncated numbers, such as 123.4k or 1.23m meaning 123400 and 1230000 respectively? I've been searching to no avail
-
-
Replying to @dbanksDesign
Like https://momentjs.com/docs/#/durations/humanize/ … but for quantities/counts
1 reply 0 retweets 0 likes -
Replying to @jtibble
Yea pretty much. I don't know what the right term is, number truncation, number rounding, number humanizing? Basically I want to be able to set N digits for a given int/float and a locale and get a string like 123.4m
1 reply 0 retweets 0 likes -
Replying to @dbanksDesign
@mathias and@DasSurma might know. It there an i18n API for number shortening or truncation? A library? A polyfill? Any suggestions?1 reply 0 retweets 0 likes -
Replying to @jtibble @dbanksDesign and
http://numeraljs.com has a "Locale" section but they are limited:https://github.com/adamwdraper/Numeral-js/tree/master/locales …
1 reply 0 retweets 0 likes -
Replying to @jtibble @dbanksDesign and
https://github.com/twitter/twitter-cldr-js … supports short number formatting and has most of the ICU locales. And a formal proposal is at https://github.com/tc39/ecma402/issues/37 … with comments and libraries.
1 reply 0 retweets 0 likes -
Replying to @jtibble @dbanksDesign and
finally, I've arrived at https://github.com/snewcomer/cldr-compact-number/blob/master/README.md … and I'm done. I'll pick this up at work and incorporate it into a new proposal I'm working on ;)
3 replies 0 retweets 3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.