From 3cd7ed54cdb5b71f0a5d091bd94ddedf6ed1a48f Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Tue, 10 Dec 2019 14:35:09 +0100 Subject: [PATCH] Explicitly set Money rounding to ROUND_HALF_EVEN This is the current default value, but it will change in the Money gem in some future release (v7). People can start adhering to that value by setting Money.rounding_mode = BigDecimal::ROUND_HALF_UP in their own application. For now, this is what we used so far and we should not change it for existing applications. Ref: https://github.com/RubyMoney/money/pull/883 --- core/config/initializers/money.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/core/config/initializers/money.rb b/core/config/initializers/money.rb index 0d216f7896b..80b18504c2d 100644 --- a/core/config/initializers/money.rb +++ b/core/config/initializers/money.rb @@ -3,3 +3,4 @@ require 'money' Money.locale_backend = :i18n +Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN