javascript convert to float 2 decimal places code example
Example 1: javascript convert string to 2 decimal
var twoPlacedFloat = parseFloat(yourString).toFixed(2)
Example 2: javascript snumber two decimal places as string
let money = 1.6;
money.toFixed(2); // 1.60
Example 3: javascript convert int to float with 2 decimal places
float_num.toFixed(2);
Example 4: get decimals from float javascript
js> 2.3 % 1
0.2999999999999998