Click to See Complete Forum and Search --> : rounding number


rogers
09-23-2003, 02:35 PM
Hello,

I have 2 numbers which are money amounts. When I perform a subtraction of the 2 numbers and then display the result, there are too many digits after the decimal point.

Why is this happening and how can I fix it so that it rounds to 2 decimal places?

I looked at the Math.round() but it rounds to nearest integer and I don't want that.

Thank you.

pyro
09-23-2003, 02:44 PM
Use to toFixed() (http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/number.html#1200964)