Sha256: 8725c1804bbd25156722529f6c18901f012d4661d14ac3a07c79fc20c980dda1

Contents?: true

Size: 279 Bytes

Versions: 10

Compression:

Stored size: 279 Bytes

Contents

require "bigdecimal"

module BaseCRM
  class Coercion
    def self.to_decimal_value(value)
      BigDecimal.new((value || 0), 15)
    end

    def self.to_string(value)
      case value
      when BigDecimal then value.to_s('F')
      else value.to_s
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
basecrm-1.3.5 lib/basecrm/utils/coercion.rb
basecrm-1.3.4 lib/basecrm/utils/coercion.rb
basecrm-1.3.3 lib/basecrm/utils/coercion.rb
basecrm-1.3.2 lib/basecrm/utils/coercion.rb
basecrm-1.3.1 lib/basecrm/utils/coercion.rb
basecrm-1.3.0 lib/basecrm/utils/coercion.rb
basecrm-1.2.3 lib/basecrm/utils/coercion.rb
basecrm-1.2.2 lib/basecrm/utils/coercion.rb
basecrm-1.2.1 lib/basecrm/utils/coercion.rb
basecrm-1.2.0 lib/basecrm/utils/coercion.rb