javascript float to string format code example
Example 1: js number 2 decimal places
(3.141596).toFixed(2); // 3.14
Example 2: javascript format float
let x = 0.548
console.log(x.toFixed(2)); // 0.54
(3.141596).toFixed(2); // 3.14
let x = 0.548
console.log(x.toFixed(2)); // 0.54