We help IT Professionals succeed at work.

java locale for number format, decimal separator->dot, thousand separator ->space.

jazzIIIlove
jazzIIIlove asked
on
Hi;

I am trying to find a locale in which the number format would be decimal separator->dot, thousand separator ->space.

Is there any? Or how should i do this?

Br.
Comment
Watch Question

Top Expert 2016

Commented:
If the decimal separator is a dot, then what would the decimal point be?
Hi CEHJ;
Long time no see :)

what i mean is this, 1 345 234.23

So is it possible to achieve this? Or not logical at all?
Top Expert 2016

Commented:
Oh OK - just a space for a thousands separator . I wouldn't either look for a Locale that has such a thing (i doubt it exists) or even create one. Just formatting is all you need
Top Expert 2015
Commented:
DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();
symbols.setGroupingSeperator(' ');
DecimalFormat df = new DecimalFormat("###,##.##", symbols);
String output = df.format(1345234.23,)

Open in new window

Smart. Thanks.