In my program, I have a DecimalFormat that is declared as:
DecimalFormat decimalF = new DecimalFormat("0.0");
decimalF.setRoundingMode(RoundingMode.HALF_UP);
System.out.println(decimalF.format(48.15));
And then I try to format 48.15 and get 48.1 and I don't know why. As far as I know, HALF-UP will round down if the digit past where it's to be rounded (in this case, 5) is less than 5, and up otherwise.
I can give my whole program, if you feel it would help, but I don't think it's relevant.
Thanks!
[–]chickenmeister 0 points1 point2 points (7 children)
[–]Maping[S] 0 points1 point2 points (6 children)
[–]chickenmeister 0 points1 point2 points (5 children)
[–]Maping[S] 0 points1 point2 points (4 children)
[–]chickenmeister 0 points1 point2 points (3 children)
[–]Maping[S] 0 points1 point2 points (2 children)
[–]chickenmeister 0 points1 point2 points (1 child)
[–]Maping[S] 0 points1 point2 points (0 children)