Class: NCore::BigMoney

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/ncore/attributes.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ BigMoney

Returns a new instance of BigMoney.



203
204
205
# File 'lib/ncore/attributes.rb', line 203

def initialize(*args)
  __setobj__(BigDecimal(*args))
end

Instance Method Details

#to_sObject



207
208
209
210
211
212
213
# File 'lib/ncore/attributes.rb', line 207

def to_s
  if (self % BigDecimal('0.01')) == 0
    '%.2f' % self
  else
    super
  end
end