You Deserved It!


#1

I dont understand what the code they added means:

// Show the total bill
console.log('Your bill is '+cashRegister.total.toFixed(2));

what is .toFixed(2) is?


#2

@nesi_tomer,
google search
== the Book ==
.toFixed() site:developer.mozilla.org
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed

== discussions / opinions ==
toFixed() site:stackoverflow.com
http://stackoverflow.com/questions/10015027/javascript-tofixed-not-rounding


#3

It is rounds the number up to 2 decimals for example

var num = 3.56789;
console.log(num.toFixed(2)) //it will print out 3.57
console.log(num.toFixed(3)) //it will print out 3.568