diff --git a/activesupport/lib/active_support/locale/en.yml b/activesupport/lib/active_support/locale/en.yml index 997541fc79..0453883a79 100644 --- a/activesupport/lib/active_support/locale/en.yml +++ b/activesupport/lib/active_support/locale/en.yml @@ -45,7 +45,7 @@ en: # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00) precision: 3 # Determine how rounding is performed (see BigDecimal::mode) - round_mode: !ruby/sym default + round_mode: default # If set to true, precision will mean the number of significant digits instead # of the number of decimal digits (1234 with precision 2 becomes 1200, 1.23543 becomes 1.2) significant: false diff --git a/activesupport/lib/active_support/number_helper/rounding_helper.rb b/activesupport/lib/active_support/number_helper/rounding_helper.rb index cdf5535bd3..14deca13ea 100644 --- a/activesupport/lib/active_support/number_helper/rounding_helper.rb +++ b/activesupport/lib/active_support/number_helper/rounding_helper.rb @@ -13,7 +13,7 @@ def round(number) precision = absolute_precision(number) return number unless precision - rounded_number = convert_to_decimal(number).round(precision, options.fetch(:round_mode, :default)) + rounded_number = convert_to_decimal(number).round(precision, options.fetch(:round_mode, :default).to_sym) rounded_number.zero? ? rounded_number.abs : rounded_number # prevent showing negative zeros end