how to format double to 2 decimal places in java code example
Example 1: java printf double 2 decimal places
printf("%. 2f", value);
Example 2: how to format a double in java to 2 decimal places
DecimalFormat df = new DecimalFormat("#.00");
printf("%. 2f", value);
DecimalFormat df = new DecimalFormat("#.00");