According to official java doc,
RoundingMode HALF_EVEN:
Rounding mode to round towards the nearest neighbor unless both neighbors are equidistant, in which case, round towards the even neighbor.
So as this is a case of equidistant neighbours, why is it still rounding off to 6.33 instead of 6.32
public static void main(String[] args) {
DecimalFormat df = new DecimalFormat("0.00");
df.setRoundingMode(RoundingMode.HALF_EVEN);
System.out.println((df.format(6.325)));
}
I am expecting the output of 6.32 for Half_EVEN roundoff but instead it yeilds 6.33.
Any help would be appreciated
Thanks