Displaying numbers in Comma format Using Java
by guruprasad[ Edit ] 2013-12-30 17:28:08
To Display the numbers in comma format:
String numWithoutComma = "123456789.254";
double numWithComma = Double.parseDouble(numWithoutComma);
DecimalFormat formatter = new DecimalFormat("#,## #.00");
System.out.println(formatter.format(numWithComma));
Output:
123,456,789.254