-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
RoundedMoney instances not rounded #277
Comments
@atsticks Any idea about that? Is it a bug or a feature that works as intended? |
I asked a similar question at stackoverflow.
Output:
(I used moneta 1.3 from Maven Central) |
@marschall I'm not sure, what's the expected behavior here, can you elaborate? Anyway we'll plan that most likely for a brand new JSR, it won't go into 1.4.1 which is due in the next few days. |
My expectation would be the following:
|
Unfortunately that example (taken from Stackoverflow) is not intuitive and leaves one to guessing when it may apply. Either way, this looks like it's way beyond a quick fix, if there was more configuration required or parameters to |
Yes, I'm an associate member. |
Well happy if you'd be willing to help with the next one, this issue IMO will take a bit of time and discussion with other members of a future EG, so we leave it to the next major version (planned to start around the end of the year if all goes well) |
When an instance of
RoundedMoney
is created the rounding operator is not applied. This compounded by the fact that operations assume the instance is rounded so the shortcuts oradd, subtract, multiply and divide just return the same, unrounded instance. The same goes for the plus, negate and abs.
I am not sure whether this behavior is intentional or not as the class comment of
RoundedMoney
does not spell out when the rounding operator should be applied. Rather the class comment seems to be copy and pasted fromMoney
.The text was updated successfully, but these errors were encountered: