javascript - Multiply numbers with more than 4 decimal points -


possible duplicate:
round number in javascript n decimal places

this may easy guys,

my question is:

how can control decimal places in floating point value.

ex.: result returning 0.365999999999999; need show 4 decimal numbers.

check demo: demo (i accept others ways calculate that)

thanks!

you can use .tofixed

var number = 0.365999999999999;     var rounded = number.tofixed(4);  // 0.3660 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -