-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Include number formatting data in the bundled ICU data #11888
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
Comments
@bojanz would you still find this data useful? |
Yes, this data is generally very useful. |
im not sure SF should compile the data, just so you can implement a NumberFormatter for the Intl component there's already a NumberFormatter stub that only supports the "en" locale, otherwise use the real NumberFormatter. As such we dont really need the data in core, unless we decide to update the stub NumberFormatter IMHO. Put different, it's a bit weird to compile the data, expose it in e.g. |
Thank you for this suggestion. |
Could I get a reply or should I close this? |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
ICU includes number formatting data in locales/$locale.txt.
It looks like this:
Or, more nicely, in json:
https://github.com/commerceguys/intl/blob/master/resources/number_format/en.json
This data also includes the decimal and grouping separators, and the plus/minus/percent signs, if they're different from the defaults.
Having this data allows us to implement a NumberFormatter that works on all locales:
https://github.com/commerceguys/intl/blob/master/src/Formatter/NumberFormatter.php
The text was updated successfully, but these errors were encountered: