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

RoundUp can round a number that shouldn't be rounded #388

Open
smaant opened this issue Nov 13, 2024 · 1 comment
Open

RoundUp can round a number that shouldn't be rounded #388

smaant opened this issue Nov 13, 2024 · 1 comment

Comments

@smaant
Copy link

smaant commented Nov 13, 2024

d := decimal.RequireFromString("3.692").Mul(decimal.RequireFromString("1.25"))
fmt.Println(d)             // 4.615
fmt.Println(d.RoundUp(3))  // 4.616

at the same time

d := decimal.RequireFromString("4.615")
fmt.Println(d.RoundUp(3))  // 4.615
@mi4tin
Copy link

mi4tin commented Dec 13, 2024

我试了下都是4.615

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