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

Specifying precision messes up results? #19

Closed
davidfaulks opened this issue Mar 19, 2019 · 1 comment
Closed

Specifying precision messes up results? #19

davidfaulks opened this issue Mar 19, 2019 · 1 comment

Comments

@davidfaulks
Copy link

var dec1 = Decimal.parse("0.256"); var dec2 = dec1 + dec1; print(dec2.toString()); print(dec2.toStringAsPrecision(20));
prints
I/flutter ( 5329): 0.512
I/flutter ( 5329): 0.51200000000000001066
in the console. I do not think this is correct behaviour for a Decimal type.

@a14n
Copy link
Owner

a14n commented Mar 19, 2019

This should be fix with rational-0.3.2 (please upgrade this dep)

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