Skip to content

Commit a69a598

Browse files
committed
Format total amount to two decimal places
1 parent 35d3973 commit a69a598

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ calculateButton.addEventListener("click", () => {
66
let amount = amountInput.value;
77
let tipPercent = tipPercentInput.value;
88
let totalAmount = amount * (1 + tipPercent / 100);
9-
outputText.innerText = `Total Amount: ${totalAmount}`;
9+
outputText.innerText = `Total Amount: ${totalAmount.toFixed(2)}`;
1010
});

0 commit comments

Comments
 (0)