• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 737
  • Last Modified:

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

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.
0
jazzIIIlove
Asked:
jazzIIIlove
  • 2
  • 2
1 Solution
 
CEHJCommented:
If the decimal separator is a dot, then what would the decimal point be?
0
 
jazzIIIloveAuthor Commented:
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?
0
 
CEHJCommented:
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
0
 
gurpsbassiCommented:
DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();
symbols.setGroupingSeperator(' ');
DecimalFormat df = new DecimalFormat("###,##.##", symbols);
String output = df.format(1345234.23,)

Open in new window

0
 
jazzIIIloveAuthor Commented:
Smart. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now