formatting a double to have 2 decimal places java code example
Example 1: how to format a double in java to 2 decimal places
DecimalFormat df = new DecimalFormat("#.00");
Example 2: java format double no decimal places
int x = (int) y
DecimalFormat df = new DecimalFormat("#.00");
int x = (int) y