• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Javascript Help with reading floats

I am writing a javascript application to do some nmerical conversions. I am farely new to Javascript so I could use some help. I have a variable that will equal a number that may or may not contain a "." so it could have a value of something like 23.4567 or 23. I need to be able to limit the value so that it only goes out to 2 decimal points and then I need to be able to separate the value by the decimal point.

ie... if it is a vlaue of 23.4567 I need to be able to pull the 23 and save it to a variable and then take the .4567 an save this to a variable. I could use some help with this.
Currently I am using ParseInt() to get the value of 23 but I don't know how to bring out the decimal portion.

thanks for the help
 
I know there's a Math.round() function but i dont know if you can specify a number of decimal places, i.e. Math.round(2) for two decimal places.
 
Back
Top