New course! Every coder should learn Generative AI!
Try a free lesson+ 1
how to fix decimal places to two?
2 Answers
+ 2
Double number;
number = Math.rint(number * 100) / 100;
+ 1
You may refer to this guide
http://tutorials.jenkov.com/java-internationalization/decimalformat.html