2

I use Decimalformat two get two decimals with this line of code

DecimalFormat df = new DecimalFormat("#0.00");

My outputs is for example like this

568,99  
1090,33
12897,45
233567,77

How can I set the decimalformat to output like this?

568,99  
1.090,33
12.897,45
233.567,77

Is there a way with the methods from Decimalformat to do this. With codes like these

 df.setMinimumFractionDigits(3);
 df.setMaximumFractionDigits(3);
 df.setMinimumIntegerDigits(1);

I never extended my knowledge about DecimalFormat, that's why I'm asking.

  1. Is this possible to do with the decimalformat code? How?

  2. Is there a better way?

Waffles.Inc
  • 3,310
  • 4
  • 13
  • 17

1 Answers1

0

I realized it does not look nice with the dots. Look here for example.

1.234.345,00

So I changed to empty space instead with this line...

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

that created this

1 234 345,00
Waffles.Inc
  • 3,310
  • 4
  • 13
  • 17