I want to format the number without the comma.
int num = 1000.123;
java.text.numberFormat nf = java.text.numberFormat.getInstance();
nf.setMaximumFractionDigits( 10 );
nf.format( num );
this returns "1,000.123" but i want instead "1000.123" how can i do?
S
Roedy Green - 17 Nov 2005 01:21 GMT
>this returns "1,000.123" but i want instead "1000.123" how can i do?
see http://mindprod.com/jgloss/decimalformat.html
http://mindprod.com/applets/converter.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Sujay - 17 Nov 2005 06:09 GMT
it is possible by defining a DecimalFormatt as "########.##0"
Pete Barrett - 17 Nov 2005 19:06 GMT
>I want to format the number without the comma.
>int num = 1000.123;
[quoted text clipped - 3 lines]
>
>this returns "1,000.123" but i want instead "1000.123" how can i do?
Try NumberFormat.setGroupingUsed(false).
Pete Barrett