Link to home
Start Free TrialLog in
Avatar of dhuma
dhuma

asked on

DeimalFormat class rounding issues

We are in the process of migrating our applications from Java 4 to Java 6

We see some issues in rounding the double numbers using Decimal Format class.
The rounding is different is different between Java 4 & java 6.

using the following pattern
new DecimalFormat("0.##");

the difference is something like this

34.35  VS 34.34

How can we force to use the same rounding pattern so that they are not different.

Are there any other classes that behave differently between the Java versions

thanks


Avatar of Mick Barry
Mick Barry
Flag of Australia image

Avatar of dhuma
dhuma

ASKER

looks like the Rounding strategy is same in Both java 4 & Java 6. However, the same number is getting rounded differently between those Java version. Does any of the other factors play a role, like 64 bit etc?

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial