Module: KktShoppe::ViewHelpers

Defined in:
lib/kkt_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 KktShoppe settings



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

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

#number_to_weight(kg) ⇒ Object

Returns a number of kilograms with the appropriate suffix



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

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