Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get correct result when giving a number #160

Closed
sofiaps opened this issue Feb 5, 2021 · 1 comment
Closed

Cannot get correct result when giving a number #160

sofiaps opened this issue Feb 5, 2021 · 1 comment

Comments

@sofiaps
Copy link

sofiaps commented Feb 5, 2021

When I try something like that:

var x = new Big(9999999999999.99999).round(5).toFixed(5);

the x always rounds up to '10000000000000.00000'.

If I give it as a string it works fine ( i.e. new Big('9999999999999.99999') gives in fact '9999999999999.99999')

@MikeMcl
Copy link
Owner

MikeMcl commented Feb 5, 2021

console.log(9999999999999.99999);    // 10000000000000

@MikeMcl MikeMcl closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants