Javascript float subtract

No, nothing wrong with your code, most decimal fractions cannot be represented exactly
in binary, use

number.toFixed(x)

Where x is the number of decimals you want and number is the result of the subtraction.

Leave a Comment