- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Indian number formatting broken #275
Comments
As I remember for China is the same |
This was among the original goals of JSR 354. It should have worked at some point, so this is also a blocker before getting the MR out. Added the Unit Test method |
Parsing of Indian/China numbers was fixed in scope of #193. See a unit test for this But I still didn't try to fix formatting of the numbers. I guess this can be done with some pattern but not sure about this. |
Any idea when the rest could be fixed? |
Well, since internally is used regular JDK's DecimalFormat so the solution should be similar. |
This looks like the Original https://stackoverflow.com/questions/5379231/displaying-currency-in-indian-numbering-format ICU4J already has support based on its own fork of |
This seems to be the bug in the JDK https://bugs.openjdk.java.net/browse/JDK-4738167 |
Do you think they're gonna fix it before the bug turns 20? ;-( |
Hope springs eternal |
Not sure why this is critical for JavaMoney. Yes, we can parse those numbers but if such formatting wasn't supported in JDK then probably it's not so important and we can wait for fix from JDK guys. Can any Indian say how much is this important? |
It makes the whole thing inconsistent, if parsing works, but formatting doesn't. Given the JDK has ignored it for nearly 20 years now, we could of course still defer it to a new JSR. @atsticks, @otaviojava WDYT? |
To make this work a custom grouping must be set on the AmountFormatContext, see AmountFormatParams. When a locale with country IN is set the RI no implicitly corrects the grouping size, if not already set explicitly. |
According to https://www.thefinancials.com/Default.aspx?SubSectionID=curformat India is the only case. China uses the default formatting as defined by the JDK. |
So is there a workaround or is it too little used to address it? |
So I guess we can also close JavaMoney/jsr354-ri-bp#55 |
Indian digit grouping is more complex than others
This means that what in the US would be formatted as
67,890,000,000,000
will be formatted in India as6,78,90,00,00,00,000
.Consider the following, failing, test:
https://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping
https://en.wikipedia.org/wiki/Indian_numbering_system
https://stackoverflow.com/questions/5379231/displaying-currency-in-indian-numbering-format
The text was updated successfully, but these errors were encountered: