-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Thousand separator (space) not working when parsing #193
Comments
Also check against the BP for consistent behavior. |
According to https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html even |
@stokito, @marschall and others, do you have an idea (and time) to address this? I already mentioned it to @atsticks, @otaviojava, but they may be on vacation right now. Especially |
I don't have any idea ATM but tomorrow will try to fix that |
Thanks, keep in mind, this is a showstopper even for the MR. All the other stuff including benchmarks are nice to have, but we can keep that till a new JSR in the course of 2019. |
org.javamoney.moneta.format.MonetaryFormatsTest.testFormatFR() currently fails because U+00A0 (NBSP) is used instead of U+0020 (SP). I believe NBSP is correct as we do not want line breaks in a number. I'm a bit confused by the fix for #151 in |
I believe parsing with of spaces as a grouping separator is in general broken because of |
WIP here https://github.com/stokito/jsr354-ri/tree/issue-193 |
I fixed the issue in the https://github.com/stokito/jsr354-ri/tree/issue-193 |
Ok guys, let's discuss the issue with Non-breaking space NBSP here. That's why parsing of amounts with a usual space is failing and that's why after formatting we have strange failed tests like JDK8 uses CLDR release 21, JDK9 uses their CLDR release 29, JDK 11 uses CLDR release 33. In your IDE you can search for a class { "NumberElements",
new String[] {
",", // decimal separator
"\u00a0", // group (thousands) separator
";", // list separator
"%", // percent sign
"0", // native 0 digit
"#", // pattern digit
"-", // minus sign
"E", // exponential
"\u2030", // per mille
"\u221e", // infinity
"\ufffd" // NaN
}
}, You may note the So let's see what is inside the latest CLDR. You may see that
And even more: they have some intentions to change this for other locales: So in fact to be prepared for the next JDK releases we should handle both NBSP and NNBSP. IMHO the Unicode guys thinking only about typography and presentation but from what I saw in their discussions they never even thinked about parsing or how to input this symbols for users. They changing the formats without even thinking about how many bugs this will produce. Why to use Narrow-NBSP? Because this can make visually easier to see that those digits are close together. But again, not all fonts supports this. In my opinion this should be fixed be replacing the space symbol with underscore But the main point against this spaces as it was already mentioned and they are not ASCII symbols and this may be unexpected for developers especially on storing or when sending to external systems. So we have several options:
So I think we should use extend third approach for all locales, not only for Bulgarian locale but latter we can add the additional boolean flag to force formatting with NBSP. |
…g numbers with thousands for locales like French and Bulgaria which uses space as a separator. Also fix formatting that fails when currency unit is not space-separated from amount.
Hello
The french thousand separator is the space character. When you parse a money amount with currency from a string it doesn't work !!
See this test case for example :
result is:
The text was updated successfully, but these errors were encountered: