gaaanz einfach:
Math.round(x * 100) / 100;
in javascript
One thought on “round a float with two digits after the comma in JS”
Comments are closed.
Dipl.-Ing. Dr. Barbara Ondrisek
gaaanz einfach:
Math.round(x * 100) / 100;
in javascript
Comments are closed.
As much as I don’t want to say that PHP did anything good for the world at all, I do like the second parameter of the round function in PHP..
http://at.php.net/round