js rount numbers 2 decimal code example
Example 1: round number 2 decimals javascript
Math.round((num + Number.EPSILON) * 100) / 100
Example 2: get decimals from float javascript
js> 2.3 % 1
0.2999999999999998
Math.round((num + Number.EPSILON) * 100) / 100
js> 2.3 % 1
0.2999999999999998