Some people have asked about formatting decimal data in Java, since the default can be ugly. I don't want to spend time on it right now, but the process isn't too bad.

First, you need to import an appropriate class:

import java.text.DecimalFormat;

Later, you need to create a variable of that class that demostrates the formatting that you want. E.g.

DecimalFormat twoDecPlacesFormat = new DecimalFormat ("0.00");

Once your program has executed that statement (and the variable is defined in the scope) you can use it to specify the formatting for a decimal number. e.g.

System.out.println("Formatted variable: " + twoDecPlacesFormat.format(adoublevar) );