I have a large amount of numeric values
x and convert the result to a string.
How do I get around the annoying floating point precision?
0.2 + 0.4 = 0.6000000000000001
Two things I have tried:
>>> y = 1.23456789 >>> x = 0.2 >>> parseInt(Math.round(Math.floor(y/x))) * x; 1.2000000000000002
>>> y = 1.23456789 >>> x = 0.2 >>> y - (y % x) 1.2000000000000002