+ 2
How can i convert from double to int? [SOLVED]
2 Respuestas
+ 6
1. Java – double to int conversion using type casting
double dnum = 99.99;
int inum=(int)dnum;
2. Java – Convert double to int using Math.round()
double dnum = 99.99;
int inum=(int) Math.round(dnum);
3. Convert double to int in Java using Double.intValue()
Double dnum = 99.99;
int inum = dnum.intValue();
+ 1
Thank you ;)