Module: ActionView::Helpers::NumberHelper

Defined in:
lib/workarea/ext/freedom_patches/action_view_number_helper.rb

Instance Method Summary collapse

Instance Method Details

#number_to_currency_with_workarea(number, options = {}) ⇒ Object Also known as: number_to_currency



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/workarea/ext/freedom_patches/action_view_number_helper.rb', line 4

def number_to_currency_with_workarea(number, options = {})
  if options[:unit].present? || options[:locale].present?
    return number_to_currency_without_workarea(number, options)
  end

  options = options.deep_dup
  options[:unit] = if number.is_a?(Money)
                     number.currency.symbol
                   else
                     Money.default_currency.symbol
                   end

  number_to_currency_without_workarea(number, options)
end