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
price, err := decimal.NewFromString("1.00")
priceFloat, _ := price.Float64()
the priceFloat is 1 ,not 1.00 I think it should be 1.00
The text was updated successfully, but these errors were encountered:
A float 1 is the same as 1.0, same as 1.00, same as 1.0000000, etc
If you need to keep the decimals, you're looking for priceFloat.StringFixedBank(2); where '2' is the nr of decimals to keep
priceFloat.StringFixedBank(2)
Sorry, something went wrong.
No branches or pull requests
price, err := decimal.NewFromString("1.00")
the priceFloat is 1 ,not 1.00
I think it should be 1.00
The text was updated successfully, but these errors were encountered: