Re: Format decimals places
"JL Smith" <firstname.lastname@example.org> 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 12:55 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.