+ 1

How do you print a two decimal output in java?

21st Oct 2021, 8:50 AM
Leoror
Leoror - avatar
2 Answers
+ 5
System.out.printf("%.2f", val);
21st Oct 2021, 9:01 AM
Coding Cat
Coding Cat - avatar
+ 1
Coding Cat Thank you!
21st Oct 2021, 9:53 AM
Leoror
Leoror - avatar