Skip to content

Commit

Permalink
Rounding to 2 decimal places
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMuellenator authored Mar 6, 2024
1 parent 8212510 commit 80f0e52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $(document).on("keydown", function (e) {
const total_tip_amount = bill * tip_as_percent;
const total_bill = bill + total_tip_amount;
const bill_per_person = total_bill / people;
const final_amount = Number(Math.round(bill_per_person, 2));
const final_amount = Number(Math.round(bill_per_person * 100) / 100);
NewLine("Each person should pay: $" + final_amount, false);

$(".console-carrot").remove();
Expand Down

0 comments on commit 80f0e52

Please sign in to comment.