I want to add a thousands separator to a double variable. I tried using String.format("%,f", x); and similar, but it seems to have a fixed number of decimal places, unlike Double.toString() .
For example , with a value of 1234.5:
Double.toString() : 1234.5
String.format() : 1.234,500000
Desired: 1.234.5
source share