Class: BigDecimal
- Inherits:
-
Object
- Object
- BigDecimal
- Defined in:
- lib/big_decimal.rb
Instance Method Summary collapse
- #in_cents ⇒ Object
- #to_s_with_format(*args) ⇒ Object (also: #to_s)
Instance Method Details
#in_cents ⇒ Object
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 |