In Files

  • bigdecimal/lib/bigdecimal/util.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

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/lib/bigdecimal/util.rb, line 145
def to_d
  BigDecimal(0)
end