format double java 1 decimal# 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