Skip to main content

How to set roundingMode for DecimalFormat in Java 1.4?

1 reply [Last post]
bernd05
Offline
Joined: 2008-12-15

hi,

is there any possibility to set the roundingMode for DecimalFormat in Java 1.4?
I know since 1.6 there exists a method which can do this but earlier??

thanks,
br bernd

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
clance_911
Offline
Joined: 2008-08-20

i have tried this for java 1.5 and DecimalFormat seems to be having fixed rounding of ROUND_HALF_EVEN.

thats how it looks on the doc too.
http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html

cheers!
-clance