format float number javascript code example
Example 1: javascript convert int to float with 2 decimal places
float_num.toFixed(2);
Example 2: javascript format float
let x = 0.548
console.log(x.toFixed(2)); // 0.54
float_num.toFixed(2);
let x = 0.548
console.log(x.toFixed(2)); // 0.54