This commit is contained in:
tparnell
2018-12-10 16:44:57 -05:00
parent d06d0b2dd3
commit 832c0e6b50

View File

@@ -24,7 +24,7 @@ function totalAmount(billTotal, selectedPer, numPpl) {
//Does the OCD calculations by rounding the total bill amount up to make a whole number. Then taking that number and subtracting it from the total bill, which gives you a new tip amount that makes the bill total to be a whole number.
let ocdTotalAmount = Math.ceil(totalAmount);
let ocdTipAmount = ocdTotalAmount - totalAmount;
let newTip = new Number((ocdTipAmount + tipAmount)).toFixed(2);
let newTip = new Number((ocdTotalAmount - billTotal)).toFixed(2);
let billInfo = {
prevBillTotal: billTotal,
@@ -57,7 +57,7 @@ function splitBill(splitTotal, numPpl) {
//Get the bill that is entered.
function getTotalbill() {
return parseInt(document.getElementById('totalBillInput').value);
return parseFloat(document.getElementById('totalBillInput').value);
}
//Get the number of people entered.
function getNumPpl() {