Working with numbers
What I learned from Code Complete
Be aware of overflow of numbers for intermediate results
Addition and subtraction on numbers with great magnitude in difference may not be accurate. 1000000+0.1 is not 1000000.1, may be 1000000.
Directly comparing floating number may not be accurate. One solution is to calculate the abs of two numbers and see if less than the acceptable range.

Rounding error
Use binary coded decimal. In JS, it probably means big ints or big floats.
Use integer instead float. For dollars and cents, you can store numbers in cents.