I have some JS calculations going on. Since floating point arithmetic often uses close approximations to numbers instead of exact values, if you round these floating point number to fixed precision, you often get slight differences. When you are dealing with dollars, people don't like these slight differences.
My problem is outlined in this jsfiddle: http://jsfiddle.net/rGP8Q/.
Does anyone know how I can do math operations (multiplication and addition) without introducing these rounding errors coming from the floating point approximations?
EDIT
I found this other post which brings up the same problem, and confirms that JS does not have a built in decimal data type: How to deal with floating point number precision in JavaScript?.
you can see if you JS terminal that
626.175.toFixed(2) == 626.17
626.185.toFixed(2) == 626.18
626.195.toFixed(2) == 626.20
which is inconsistent. We need a true decimal data type.