Decimals
We can use the toFixed
method to add decimal points to an integer:
var number = 3;
var result = number.toFixed(2);
console.log(result); // 3.00
We can use the toFixed
method to add decimal points to an integer:
var number = 3;
var result = number.toFixed(2);
console.log(result); // 3.00