How to round up a double value to the desired decimal
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Biju_Nair
Posted On:   Tuesday, November 2, 2004 01:24 AM

Hi I am having a problem in rouding up the double value for the number of decimal point. the situation is as below I am having a double value like 0.34444666 I want to round it up to the two decimal point.I tried with different approach java suggested.But i am always getting it as 0.34 only but actualy it is suppose to be 0.35. And it is working fine if the double value is something like 0.34666 it is rounding to 0.35 can anybody help me on this. Thanks in advance K.Biju    More>>

Hi


I am having a problem in rouding up the double value for
the number of decimal point.

the situation is as below

I am having a double value like 0.34444666 I want to round
it up to the two decimal point.I tried with different
approach java suggested.But i am always getting it as
0.34 only but actualy it is suppose to be 0.35.

And it is working fine if the double value is something like

0.34666 it is rounding to 0.35


can anybody help me on this.


Thanks in advance


K.Biju

   <<Less

Re: How to round up a double value to the desired decimal

Posted By:   Pavan_Gattu  
Posted On:   Wednesday, November 3, 2004 08:53 PM

You can check BigDecimal class. This provides ways to round off the values.
About | Sitemap | Contact