Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

February 11, 2010

6 Comments

Javascript floating point precision(Sets the number of decimal points)

If you have a problem with floating point precision when you update any number in html using javascript/jquery than here i show you the way how to get number formatted with decimals (set 2 digits after decimal point in float number) from javascript. In PHP, you can simply use number_format() function and pass the parameter as you want for floating point precision(Sets the number of decimal points).