I'm trying to add some numbers together with Javascript and having issues with JavaScript rounding the numbers incorrectly. Wondering if anyone knows how to work around this issue.
Issue:
If I enter 5.99 in first box and 5.11 in second I get 11.100000000000001 as a result, it should be 11.1. Any one know why or a work around?
Floating point precision errors... not much you can do about it, really. Happens in most languages. Best you can do is to format your numbers so that the effect of the errors is minimized.
Bookmarks