To format numbers like currency without currency symbol and without grouping it is enough to declare:
If we need to change the locale formatting, then we have to add:
For more details consult Java API - DecimalFormat.
NumberFormat format = new DecimalFormat( "#####0.00" );
If we need to change the locale formatting, then we have to add:
DecimalFormatSymbols dfs = new DecimalFormatSymbols( Local.UK ); NumberFormat format = new DecimalFormat( "#####0.00", dfs );
For more details consult Java API - DecimalFormat.
No comments:
Post a Comment