class Money

def self.rounding_mode(mode = nil)

Returns:
  • (BigDecimal::ROUND_MODE) - rounding mode

Parameters:
  • mode (BigDecimal::ROUND_MODE) --
def self.rounding_mode(mode = nil)
  if mode
    warn "[DEPRECATION] calling `rounding_mode` with a block is deprecated. Please use `.with_rounding_mode` instead."
    return with_rounding_mode(mode) { yield }
  end
  return Thread.current[:money_rounding_mode] if Thread.current[:money_rounding_mode]
  if @using_deprecated_default_rounding_mode
    warn '[WARNING] The default rounding mode will change from `ROUND_HALF_EVEN` to `ROUND_HALF_UP` in the ' \
         'next major release. Set it explicitly using `Money.rounding_mode=` to avoid potential problems.'
    @using_deprecated_default_rounding_mode = false
  end
  @rounding_mode
end