Module: MuckCommerce::CurrencyMethods

Defined in:
lib/muck-commerce/share/currency_methods.rb

Instance Method Summary collapse

Instance Method Details

#amount_dollarsObject

Assumes a field named amount



10
11
12
# File 'lib/muck-commerce/share/currency_methods.rb', line 10

def amount_dollars
  cents_to_dollars(self.amount)
end

#amount_dollars=(val) ⇒ Object

Assumes a field named amount



5
6
7
# File 'lib/muck-commerce/share/currency_methods.rb', line 5

def amount_dollars= val
  self.amount = dollars_to_cents(val)
end

#amount_priceObject

Assumes a field named amount Get the order amount as a formatted currency instead of as cents.



16
17
18
# File 'lib/muck-commerce/share/currency_methods.rb', line 16

def amount_price
  format_currency(self.amount)
end