how to print 4 digit after decimal in java code example Example: print up to 2 decimal in java System.out.printf("%.2f", value);