Module: Tienda::ViewHelpers

Defined in:
lib/tienda/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 Tienda settings



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

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

#number_to_weight(kg) ⇒ Object

Returns a number of kilograms with the appropriate suffix



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

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