Class: BigDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/proc/msgpack/types/decimal.rb

Instance Method Summary collapse

Instance Method Details

#to_msgpack(packer) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/proc/msgpack/types/decimal.rb', line 6

def to_msgpack(packer)
  if precision > 16
    packer.write(Proc::Msgpack::Types::Decimal.new(self))
    packer
  else
    to_f.to_msgpack(packer)
  end
end