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
Post a Comment