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 printf for a one liner
System.out.printf("The original balance is $%.2f.%n", cardBalance);
This will always print two decimal places, rounding as required.