Re: Format decimals places
"JL Smith" <email@example.com> wrote in
> I have a double and I want it to always have two decimal places behind
> it. How would I do this? Thanks for any help!
You can make use of the class NumberFormat or the class DecimalFormat
in the java.text package. They provide many manipulation on the number
representation. The method setMaximumFractionDigits() is the one you want I
think. Hope this can help you.
|All times are GMT. The time now is 05:15 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.