print up to 0 decimal places java code example Example: print up to 2 decimal in java System.out.printf("%.2f", value);