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

output 0 #290

Open
prettyCoders opened this issue Jul 12, 2022 · 1 comment
Open

output 0 #290

prettyCoders opened this issue Jul 12, 2022 · 1 comment

Comments

@prettyCoders
Copy link

v1, _ := decimal.NewFromString("1")
v2, _ := decimal.NewFromString("1000000000000000000")
fmt.Println(v1.Div(v2))

@th3m477
Copy link

th3m477 commented Jul 30, 2022

The API isn't clear here.

Div uses DivRound underneath, so you can pass in 18 as precision to get your desired result.

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