A DESCRIPTION OF THE PROBLEM :
RoundingMode.HALF_UP is not working correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1.985 : 1.98
23.985 : 23.98
Hello World
ACTUAL -
1.985 : 1.99
23.985 : 23.98
Hello World
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
import java.math.RoundingMode;
public class Main
{
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("##.00");
df.setRoundingMode(RoundingMode.HALF_UP);
System.out.println("1.985 : " + df.format(1.985));
System.out.println("23.985 : " + df.format(23.985));
System.out.println("Hello World");
}
}
---------- END SOURCE ----------
FREQUENCY : always
RoundingMode.HALF_UP is not working correctly.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1.985 : 1.98
23.985 : 23.98
Hello World
ACTUAL -
1.985 : 1.99
23.985 : 23.98
Hello World
---------- BEGIN SOURCE ----------
import java.text.DecimalFormat;
import java.math.RoundingMode;
public class Main
{
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("##.00");
df.setRoundingMode(RoundingMode.HALF_UP);
System.out.println("1.985 : " + df.format(1.985));
System.out.println("23.985 : " + df.format(23.985));
System.out.println("Hello World");
}
}
---------- END SOURCE ----------
FREQUENCY : always