I believe that the comma in your format string is not really a comma - it is just the grouping symbol in DecimalFormatSymbols that you use.
Try the following:
// TODO: Consider specifying a locale DecimalFormatSymbols symbols = new DecimalFormatSymbols(); symbols.setGroupingSeparator(' '); DecimalFormat df = new DecimalFormat("###,###.00", symbols);
Or as an alternative to the last line:
DecimalFormat df = new DecimalFormat(); df.setDecimalFormatSymbols(symbols); df.setGroupingSize(3); df.setMaximumFractionDigits(2);
Jon skeet
source share