You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cui Xiaojing-a13339 <a1...@motorola.com> on 2004/02/27 07:38:02 UTC
Number Format
Hello All,
I need to format number 12345.00 to 12345, I use below code to do the format, but the result is 12,345. Could please give some advice about how to delete the separator. Thanks a lot.
NumberFormat nf= NumberFormat.getInstance();
nf.setMaximumFractionDigits(0);
nf.setMinimumFractionDigits(0);
((DecimalFormat)nf).setDecimalSeparatorAlwaysShown(false);
Regards,
Xiaojing
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Number Format
Posted by Joseph Shraibman <jk...@selectacast.net>.
Quick and easy way: cast to an int
Cui Xiaojing-a13339 wrote:
> Hello All,
>
> I need to format number 12345.00 to 12345, I use below code to do the format, but the result is 12,345. Could please give some advice about how to delete the separator. Thanks a lot.
>
> NumberFormat nf= NumberFormat.getInstance();
> nf.setMaximumFractionDigits(0);
> nf.setMinimumFractionDigits(0);
> ((DecimalFormat)nf).setDecimalSeparatorAlwaysShown(false);
>
> Regards,
> Xiaojing
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org