-
Notifications
You must be signed in to change notification settings - Fork 142
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
Why does money.New() take an int64 #30
Comments
Hi @vendion, Why you see problem using
if your project requires usage of float, |
So some of the issues I see with taking ints are: 1) One advantage Go's I wasn't trying to say that this implementation was bad/wrong or anything, it just seems odd to me and when I was originally looking for a good way to handle currency, it seemed like |
Anyways, closing this as you pretty much answered my question with the fact that |
Just a thought, but I would add here that while forcing the responsibility on lib users to do their own float conversion minimizes complexity for |
By making
money.New()
accept anint64
rather than a float or more inline with other libraries do (possibly more idiomatic?) a*big.Float
it cuts off the ability to use a value with a decimal amount during allocation.The text was updated successfully, but these errors were encountered: