We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
x.Round(n) will rescale the number so that the coefficient contains exactly n digits
x.Round(n)
However x.RoundUp(n) and seemingly RoundCeil, RoundDown, etc do not exhibit the same behaviour.
x.RoundUp(n)
amount, _ := decimal.NewFromString("0.01230000000000000000000000000000") fmt.Printf("amount.RoundUp coefficient 64: %v\n", amount.RoundUp(4).CoefficientInt64()) fmt.Printf("amount.Round coefficient 64: %v\n", amount.Round(4).CoefficientInt64()) // amount.RoundUp coefficient 64: -2609795702905110528 // amount.Round coefficient 64: 123
Is this expected behaviour?
The text was updated successfully, but these errors were encountered:
Thanks for the report! I'll take a look at that, but at first glance, it looks like an inconsistent behavior that should be fixed. :3
Sorry, something went wrong.
No branches or pull requests
x.Round(n)
will rescale the number so that the coefficient contains exactly n digitsHowever
x.RoundUp(n)
and seemingly RoundCeil, RoundDown, etc do not exhibit the same behaviour.Is this expected behaviour?
The text was updated successfully, but these errors were encountered: