From: ShaneHoffa on
How do I round a number to a specific decimal point value in javascript?

Example: a value of 1.845698. I need Director to convert it to 1.84.

Thank you.

Shane
From: duckets on
Perhaps you could multiply by 100, then use parseInt(), then divide by 100?

- Ben
From: Ex Malterra on
you can use toFixed(2) to round the value to 2 decimal places. you won't get
1.84 though, you'll get 1.85 because the thirde decimal place is 5. 5 or higher
gets rounded up. toFixed technically returns a string, but javascript isn't
strongly typed so that's not really an issue. if you atempt an arithemetic
operation on "1.85" the value is automatically type cast to a number. so
2*"1.85" will return the same as 2*1.85.