Class: BigDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/big_decimal.rb

Instance Method Summary collapse

Instance Method Details

#in_centsObject



12
13
14
# File 'lib/big_decimal.rb', line 12

def in_cents
  (self * 100).to_i
end

#to_s_with_format(*args) ⇒ Object Also known as: to_s



2
3
4
5
6
7
8
# File 'lib/big_decimal.rb', line 2

def to_s_with_format(*args)
  if args.empty?
    "%.2f" % self
  else
    to_s_without_format(*args)
  end
end