f-angi
5/23/2017 - 8:41 AM

Formats a number with 2 decimal digits (only if needed).

Formats a number with 2 decimal digits (only if needed).

DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(Locale.ITALY);
decimalFormatSymbols.setGroupingSeparator(' '); // overrides the '.' separator proper of the Italian Locale
new DecimalFormat("#,###.##", decimalFormatSymbols).format(aNumber);