how to print 2 decimal places of double 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");