public class MyClass {
public static void main(String args[]) {
double x=120.38;
System.out.println(Math.round(x));
}
}
Output: 120
But I want an output of 121
Rounding off any decimal values to 1 whole number
public class MyClass {
public static void main(String args[]) {
double x=120.38;
System.out.println(Math.round(x));
}
}
Output: 120
But I want an output of 121
Rounding off any decimal values to 1 whole number