You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issues section is used only for bug reports. Please use the Discussions section to ask questions and share ideas and suggestions.
Describe the bug
I am trying to convert a decimal representation of a percent to a integer. So I am multiplying the number by 100, but the result is not something I expected.
To Reproduce
const math = require('mathjs');
math.chain(0.0749).multiply(100).done();
7.489999999999999
Any help in fixing this? I would round, but I don't always know how many decimals I need.
I am currently using v 12.4.1
The text was updated successfully, but these errors were encountered:
This is the most asked question. It is a floating point round-off error. You can either use format to hide the round-off error in the output, or use BigNumber to work with a higher precision.
The issues section is used only for bug reports. Please use the Discussions section to ask questions and share ideas and suggestions.
Describe the bug
I am trying to convert a decimal representation of a percent to a integer. So I am multiplying the number by 100, but the result is not something I expected.
To Reproduce
Any help in fixing this? I would round, but I don't always know how many decimals I need.
I am currently using v 12.4.1
The text was updated successfully, but these errors were encountered: