module Tienda::ViewHelpers

Public Instance Methods

number_to_currency(number, options = {}) click to toggle source

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

Calls superclass method
# 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) click to toggle source

Returns a number of kilograms with the appropriate suffix

# File lib/tienda/view_helpers.rb, line 11
def number_to_weight(kg)
  "#{kg}#{t('tienda.helpers.number_to_weight.kg', default: 'kg')}"
end