javascript limit number to two decimal places code example
Example 1: javascript round to 2 digits
var num = 2;
var roundedString = num.toFixed(2);// 2.00
Example 2: limit numbers after decimal point in javascript
var num = 5.56789;
var n = num.toFixed(2);
Example 3: get decimals from float javascript
js> 2.3 % 1
0.2999999999999998