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

Multiple operations and rounding #6

Open
jodastephen opened this issue Dec 10, 2012 · 2 comments
Open

Multiple operations and rounding #6

jodastephen opened this issue Dec 10, 2012 · 2 comments
Labels

Comments

@jodastephen
Copy link
Member

From https://sourceforge.net/u/brokenwren/profile/
https://sourceforge.net/p/joda-money/bugs/4/

It looks like the Money performs all math that might have fractions of cents using a RoundingMode. This will cause issues with multiple operations and money loss. If you multiple by a couple of numbers, do some division, add a few things, do some more division, you'll end up losing multiple cents along the way. This happens frequently in financial applications and many others as well.

There needs to be a way to perform multiple calculations on a Money instance without any rounding and then round at the end. The BigMoney doesn't quite provide this. Perhaps a MoneyMath container (or building pattern) of some sort that can provide multiple operations and in the end provide back a Money instance.

@jodastephen
Copy link
Member Author

I guess I'm not sure exactly what you're looking for. BigMoney simply wraps a BigDecimal, and should expose all the key methods to do what you want. Perhaps there is a method from BDecimal that it should expose but doesn't? Happy to take a look a pull requests if that is easier..

@gigs2go
Copy link

gigs2go commented Apr 13, 2013

Please see https://github.com/gigs2go/joda-money-calculator for a simple implementation (also includes #4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants