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

Precision clarification #121

Open
caycaycarly opened this issue Jul 24, 2022 · 1 comment
Open

Precision clarification #121

caycaycarly opened this issue Jul 24, 2022 · 1 comment

Comments

@caycaycarly
Copy link

I've been using the lib with a precision of 34, and I've noticed that when using Text(), some of my decimals terminate with ...9999999 or ..0000001. I suspect it's got something to do with this.

Is there a way I can avoid having such errors, because my PoC app requires a certain sum total to be exactly zero, even at the precision of 34, which I can't achieve with such errors. I have to use f and can't use scientific notation. I'd like to know why this error occurs, and why it can't be fixed, because I've noticed the shopspring lib having a similar problem.

@caycaycarly
Copy link
Author

caycaycarly commented Jul 24, 2022

Precision sets the number of decimals apart from contiguous zero decimals right after the decimal point. How do I truncate the number of decimals? That would solve my problem https://go.dev/play/p/oYrTqqzgJpB

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

1 participant