config/initializers/string.rb
# Similar to how ActiveRecord does. See lib/active_record/type/decimal.rb
Similar to how ActiveRecord does.
Similar to how ActiveRecord does .
def to_d
    str_decimal = delete_suffix('.')
    return BigDecimal(0) if str_decimal.blank?
    BigDecimal(str_decimal)
  end
def to_d str_decimal = delete_suffix ( '.' ) return BigDecimal ( 0 ) if str_decimal . blank? BigDecimal ( str_decimal ) end
Similar to how ActiveRecord does.
Similar to how ActiveRecord does .