how to set number of decimal places double in java code example
Example 1: java double 2 decimal
String result = String.format("%.2f", value);
Example 2: java 2 decimals
double res = Math.round(a * 100) / 100;
String result = String.format("%.2f", value);
double res = Math.round(a * 100) / 100;