To print real numbers with 2 digits to the right of the decimal point, do the following: At the beginning of your program, place the following import statement - import java.text.DecimalFormat; In your main method, preferably in the same section of code where your programs variables are declared, place the following definition: DecimalFormat twoDigits = new DecimalFormat("0.00"); This creates a reference to a DecimalFormat object, called twoDigits, which is used to print real numbers with two places to the right of the decimal point. Suppose you have a double variable called average. To print the variable average with two places to the right of the decimal point, the statement would be: System.out.println("Average is "+twoDigits.format(average));