java - Parse String to Long using a specified locale (sv) and NumberFormat -



java - Parse String to Long using a specified locale (sv) and NumberFormat -

i tried parse string (14 123) long in java using swedish locale using code:

string longstring = "14 123" numberformat swedishnumberformat = numberformat.getinstance(new locale("sv")); system.out.println(swedishnumberformat.parse(longstring).longvalue());

the output of code 14 (it should 14123). per this question tried both sv , sv_se locale time result identical in both cases.

according http://www.localeplanet.com/java/sv/index.html , http://www.localeplanet.com/java/sv-se/index.html grouping separator in both cases space() why string long parsing not handle a, locale, formatted double value stored string?

swedish, french too, needs hard. non-breaking space.

longstring = longstring.replace(' ', '\u00a0');

cumbersome.

java string parsing locale

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -