rtroxler
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by rtroxler
-
-
Why did JS return 38758.700000000004 from this calculation (3875870 * .01)?
Why did JS return 38758.700000000004 from this calculation (3875870 * .01)?
Multiplication Question
in JavaScript
Posted
Dividing by zero is what I did to resolve but it just bothered me that a basic calculation didn't return what I expected. I am fairly new to JS and I have never seen this any place else.Had a addition go funky on me too (3698850.26 + 883.34) came out as 373609.60000000003. Is there a better method or variable type to use for calculations? For the addition error, I stripped decimal position out, added the two whole numbers then divided by 100 to replace the decimal point. Sure a lot of work just to do basic math.Thanks for the input all.