float format javascript code example
Example 1: javascript snumber two decimal places as string
let money = 1.6;
money.toFixed(2); // 1.60
Example 2: javascript format float
let x = 0.548
console.log(x.toFixed(2)); // 0.54
let money = 1.6;
money.toFixed(2); // 1.60
let x = 0.548
console.log(x.toFixed(2)); // 0.54