Split digits with spaces by groups of 3 in java

Viewed 7710

Is there any way to split a double number in java so that all groups of 3 digits are splitted with a space and only 2 digits after a comma are appeared? It's easy to separate them with a comma:

DecimalFormat df = new DecimalFormat("###,###.00");
df.format(number);

So that 235235.234 turns into 234,234.23

What I need is 234 234.23

How can I do that?

1 Answers
Related