This is not an error.
Javascript is trying to represent 5.32
with as much precision as possible. Since computers don't have infinite precision, it picks the closest number it can: 5.319999999999999
.
An error margin of 0.0000000000001 should be more than acceptable, no?
You can always round the number to less decimal digits, or (if your problem is visual) use toFixed()
to create a rounded human-readable string:
number = 123.4567
number.toFixed(2)
> '123.46'