I resolved it using:

                double result = //old result//
                *100

                double newresult =(Math.round(result));

                double finalresult = (newresult) / 100;

On 12 abr, 14:29, Harsh J <qwertyman...@gmail.com> wrote:
> 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....
>
>
>
>
>
>
>
>
>
> On Tue, Apr 12, 2011 at 10:25 PM, Gabriel <gab...@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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Harsh Jhttp://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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to