How can i convert from double to int? [SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can i convert from double to int? [SOLVED]

4th Dec 2018, 1:00 PM
kritomas
kritomas - avatar
2 Answers
+ 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();
4th Dec 2018, 1:30 PM
Prokopios Poulimenos
Prokopios Poulimenos - avatar
+ 1
Thank you ;)
4th Dec 2018, 1:36 PM
kritomas
kritomas - avatar