print float with 3 digits java code example Example: 2 decimal places print format JAVA printf(%.2f);