Tell us what’s happening:
Can anyone help explain why cash-price, or 20.3 - 19.5, outputs a value of 0.8000000000000007 rather than just .8.
thanks for any help!
Your code so far
function checkCashRegister(price, cash, cid) {
var change;
console.log(cash-price);
return change;
}
checkCashRegister(19.5, 20.3, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
.
Challenge: Cash Register
Link to the challenge: