Module: Shoppe::ViewHelpers

Defined in:
lib/shoppe/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#number_to_currency(number, options = {}) ⇒ Object

Returns currency values with the currency unit as specified by the Shoppe settings


5
6
7
8
# File 'lib/shoppe/view_helpers.rb', line 5

def number_to_currency(number, options = {})
  options[:unit] ||= Shoppe.settings.currency_unit
  super
end

#number_to_weight(kg) ⇒ Object

Returns a number of kilograms with the appropriate suffix


11
12
13
# File 'lib/shoppe/view_helpers.rb', line 11

def number_to_weight(kg)
  "#{kg}#{t('shoppe.helpers.number_to_weight.kg', :default => 'kg')}"
end