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
I found that a small negative amount will be split wrongly.
Example
package main import ( "fmt" "github.com/Rhymond/go-money" ) func main() { var val = money.New(-2, "EUR") parts, err := val.Split(3) if err != nil { fmt.Println(err) } for _, part := range parts { fmt.Println(part.Display()) } }
Expected output
-€0.01 -€0.01 -€0.00
Actual output
€0.01 €0.01 €0.00
It seems that if a money value is less than the number of split parts it returns a wrong sign because 0.04/3 returns 0.02,0.01,0.01.
The text was updated successfully, but these errors were encountered:
#106 Split of small negative values doesn't work properly
8ba36bb
#106 Split of small negative values doesn't work properly (#107)
affffaf
Thanks, Great find! The issue is fixed and released in v1.0.6 release
Sorry, something went wrong.
No branches or pull requests
I found that a small negative amount will be split wrongly.
Example
Expected output
Actual output
It seems that if a money value is less than the number of split parts it returns a wrong sign because 0.04/3 returns 0.02,0.01,0.01.
The text was updated successfully, but these errors were encountered: