How to convert a double value to int doing the following:
double
int
Double If x = 4.97542. Convert to int x = 4. Double If x = 4.23544. Conv
If the double is a Double with capital D (a boxed primitive value):
Double
Double d = 4.97542; int i = (int) d.doubleValue(); // or directly: int i2 = d.intValue();
If the double is already a primitive double, then you simply cast it:
double d = 4.97542; int i = (int) d;