javascript get numbers after decimal point code example
Example 1: javascript round to 2 digits
var num = 2;
var roundedString = num.toFixed(2);// 2.00
Example 2: round number 2 decimals javascript
Math.round((num + Number.EPSILON) * 100) / 100
Example 3: get decimals from float javascript
js> 2.3 % 1
0.2999999999999998