Open kennyklee opened 7 years ago
There is an issue with using native toFixed() function to apply precision for long decimals (e.g., greater than 15).
toFixed()
Expected: accounting.toFixed(1.005, 20); // "1.00499999999999989342"
accounting.toFixed(1.005, 20); // "1.00499999999999989342"
Actual: accounting.toFixed(1.005, 20); // "1.00500000000000000000"
accounting.toFixed(1.005, 20); // "1.00500000000000000000"
Likelihood of this bug being spotted in the wild is probably really low.
There is an issue with using native
toFixed()
function to apply precision for long decimals (e.g., greater than 15).Expected:
accounting.toFixed(1.005, 20); // "1.00499999999999989342"
Actual:
accounting.toFixed(1.005, 20); // "1.00500000000000000000"