Tuesday, April 12, 2011

Re: [android-developers] Rounding Numbers

There is a DecimalFormat class generally available in Java. It can
handle the precision amongst other things (like separator character
based on locale, currency unit based on locale, etc.) while
string-representing doubles.

Here's the full API:
http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html

On Tue, Apr 12, 2011 at 10:25 PM, Gabriel <gablw2@gmail.com> wrote:
> I have a calculator app and I want to round the number after comma.
>
> Like, if the result is 15,33333 I want to keep it on 15,33 or 15,3
>
> Does any know how to do that?
>
> Thanks, I really appreciate the help
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
Harsh J
http://harshj.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate