How can I use String.format(format, args) to format a double like below?
String.format(format, args)
2354548.235 -> 2,354,548.23
2354548.235
2,354,548.23
String.format("%1$,.2f", myDouble);
String.format automatically uses the default locale.
String.format
2.1m questions
2.1m answers
60 comments
57.0k users