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 <[email protected]> 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 [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

