-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Compact Decimal Format to abbreviate large numbers #37
Comments
More details about CLDR Compact Decimal Format here: http://www.unicode.org/cldr/charts/27/summary/pl.html#4032 |
Probably same algorithm will be useful as for issue #32. ("1.2 M" vs. "2.5 KB") |
Spec: UTS #35 (HEAD) |
cc @steveluscher due to its related proposal https://gist.github.com/steveluscher/4b54e08aa1e0536b7cb9 |
Can you link to this rounding discussion in your list of open questions, @caridy? |
@steveluscher added. |
Any progress/plan for this proposal? |
It is an active proposal, but we need a champion! |
See my follow-up in #215 |
Here is a library being used in applications across the Ember community based on this proposal. JS lib: https://github.com/snewcomer/cldr-compact-number |
The new js> print(new Intl.NumberFormat('en', { notation: "compact", compactDisplay: "long" }).format(1_000_000))
1 million |
Yep, the proposal has been merged. Closing as Fixed |
CLDR contains the details to abbreviate large numbers, e.g.:
@rxaviers proposed this feature a while ago IIRC, but I could find the thread, so I'm posting it here to formalize the proposal.
Proposal
This proposal goes hand-to-hand with the pluralization (#34) since it will have to compute what's the pluralization token to choose the right format (In the CLDR data you will see that for english we have a lot of
*-count-one
and*-count-other
).The initial proposal could be to add one more configuration to specify either:
a)
best-fit
for the abbreviation, which means we choose the biggest matching decimal from the segmentsb) the decimal reference to force to use a particular formatting option (e.g.:
10000
, which could produce1234K
);Open questions
$12M
.new Intl.NumberFormat()
1M
vs1.2M
1M
vs1 Million
(this will probably require another configuration to specifylong
vsshort
./cc @jfparadis @zbraniecki
The text was updated successfully, but these errors were encountered: