We get just 2 digits after the decimal point
Example
var result = Math.round(original*100)/100;
Example:
var x = 5.0364342423;
alert(x.toFixed(2));
Result: 5.04.
Example:
var x = parseInt(5.0364342423);
alert(x.toFixed(2));
Result: 5.04.
Example
var result = Math.round(original*100)/100;
Example:
var x = 5.0364342423;
alert(x.toFixed(2));
Result: 5.04.
Example:
var x = parseInt(5.0364342423);
alert(x.toFixed(2));
Result: 5.04.
No comments:
Post a Comment