remove deprecations related with rounding mode#1144
Merged
yukideluxe merged 4 commits intomainfrom Jul 23, 2025
Merged
Conversation
mrsimo
reviewed
Jul 15, 2025
| @@ -487,7 +487,7 @@ You can set the default rounding mode by passing one of the `BigDecimal` mode en | |||
| ```ruby | |||
There was a problem hiding this comment.
Do we want to update something more in the README? In the example code, for example, it passes BigDecimal::ROUND_HALF_UP to the round method, even though it's the new default.
34771d0 to
12c79f4
Compare
45a8b06 to
106785c
Compare
2f0f4bd to
61c1c5f
Compare
106785c to
db6571f
Compare
sunny
reviewed
Jul 23, 2025
8910096 to
b6ffadd
Compare
aeb1f19 to
6c1d7c7
Compare
b6ffadd to
dde6e90
Compare
dde6e90 to
4d2ca1b
Compare
095860b to
dc3f52b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello @RubyMoney/core and contributors!
Another deprecation out of the way before releasing a new major version! 🎉 This one was originally introduced in this PR.
As explained in this comment, the rationale for changing the default rounding mode is:
Out of curiosity – and to make sure we’re making the right call! – I asked ChatGPT for a summary of the different rounding modes. Besides summarizing them, it also brought up two interesting points:
As of Ruby 3.2, the default rounding mode is now

BigDecimal::ROUND_HALF_UP. I am always down on using the defaults. I double-checked it in the official docs:It also noted: "Use
ROUND_HALF_EVENwhen doing financial calculations to reduce cumulative rounding error". This had me thinking because, after all, this gem is calledmoney. But as @antstorm pointed out, many users might not be doing large-scale aggregations and could get unexpected results withROUND_HALF_EVENbecause of the way it behaves (more about that at the bottom).I’m inclined to go ahead and change the default to
ROUND_HALF_UP, especially since it's easy to override if someone needs the previous behavior. Plus, this comment mentions that Stripe usesROUND_HALF_UPso I am convinced 💪🏻PS: Quick ChatGPT summary of the difference between the two modes and a table with examples: