I need to format the double \"amt\" as a dollar amount println(\"$\" + dollars + \".\" + cents) such that there are two digits after the decimal.
What is the best wa
You can use a DecimalFormat
DecimalFormat df = new DecimalFormat("0.00"); System.out.println(df.format(amt));
That will give you a print out with always 2dp.
But really, you should be using BigDecimal for money, because of floating point issues