I noticed that your example is dealing with dollar amounts. If you want a nice, readable currency representation that is easy to format for different countries, you can use the NumberFormat class.
Code:
import java.text.NumberFormat;
import java.util.Locale;
public class NumberFormatExample {
public static void main( String[] args ) {
double cost = 123.456;
NumberFormat currency = NumberFormat.getCurrencyInstance(Locale.US);
System.out.println( currency.format( cost ) );
}
}
There are many other ways of formatting the output using the NumberFormat class. Check it out in the API.