class NilClass

Public Instance Methods

to_d → bigdecimal click to toggle source

Returns nil represented as a BigDecimal.

require 'bigdecimal'
require 'bigdecimal/util'

nil.to_d   # => 0.0
# File bigdecimal-3.1.8/lib/bigdecimal/util.rb, line 182
def to_d
  BigDecimal(0)
end