how can i round up a floating point number to the next integer value in Java? Suppose
2.1 -->3 3.001 -->4 4.5 -
2.1 -->3
3.001 -->4
4.5 -
try this
float a = 4.5f; int d = (int) Math.ceil(a); System.out.println(d);