Skip to content

Commit 7342df7

Browse files
committed
Add more display outputs
1 parent c748fd8 commit 7342df7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ calculateButton.addEventListener("click", () => {
88
let tipPercent = parseFloat(tipPercentInput.value); //get tip percent value
99
let totalAmount = amount * (1 + tipPercent / 100); //get total billing amount
1010
let tipAmount = amount * (tipPercent / 100); //get tip amount
11-
outputText.innerText = `Total Amount: ${totalAmount.toFixed(2)}\nTip Amount: ${tipAmount.toFixed(2)}`; //set output text area to format total billing amount and tip amount
11+
outputText.innerText = `
12+
Total Amount: ${totalAmount.toFixed(2)}
13+
Tip Amount: ${tipAmount.toFixed(2)}
14+
Tip Percent: ${tipPercent}%
15+
Bill Amount: ${amount.toFixed(2)}
16+
`; //set output text area to format total billing amount, tip amount, tip percent and bill amount
1217
});

0 commit comments

Comments
 (0)