lib/money/money/formatting.rb
# Applies decimal mark from rules to formatted
#
# @param [String] formatted
# @param [Hash]   rules
Applies decimal mark from rules to formatted
Applies decimal mark from rules to formatted
def apply_decimal_mark_from_rules(formatted, rules)
      if rules.has_key?(:decimal_mark) && rules[:decimal_mark] &&
        rules[:decimal_mark] != decimal_mark
        regexp_decimal = Regexp.escape(decimal_mark)
        formatted.sub!(/(.*)(#{regexp_decimal})(.*)\Z/,
                       "\\1#{rules[:decimal_mark]}\\3")
      end
    end
def apply_decimal_mark_from_rules ( formatted , rules ) if rules . has_key? ( :decimal_mark ) && rules [ :decimal_mark ] && rules [ :decimal_mark ] != decimal_mark regexp_decimal = Regexp . escape ( decimal_mark ) formatted . sub! ( / (.*)( #{ regexp_decimal } )(.*) \Z / , "\\1#{rules[:decimal_mark]}\\3" ) end end
Applies decimal mark from rules to formatted
Applies decimal mark from rules to formatted
formatted
<not_specific>
rules
<not_specific>
<not_specific>
None