How to round number after decimal useing double | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to round number after decimal useing double

Example 38.567 but I want the print to say 38.57?

24th Sep 2017, 6:23 PM
Joshua Smith
Joshua Smith - avatar
1 Answer
+ 15
System.out.printf("%.2f", 38.567);
24th Sep 2017, 6:26 PM
Dev
Dev - avatar