I am trying to round 16.275 to 2 decimal places in Java using Math.round(). It should be 16.28, but it keeps printing 16.27.
double x = 16.275;
x = Math.round(x*100.0)/100.0;
System.out.println(x);
Could someone explain what I need to change to get 16.28? Thank you!