Method: Invoicing::CurrencyValue::ClassInfo#format_value

Defined in:
lib/invoicing/currency_value.rb

#format_value(object, value, options = {}) ⇒ Object

Formats a numeric value as a nice currency string in UTF-8 encoding. object is the model object carrying the value (used to determine the currency).



269
270
271
272
273
274
275
276
# File 'lib/invoicing/currency_value.rb', line 269

def format_value(object, value, options={})
  options = all_options.merge(options).symbolize_keys
  intercept = options[:value_for_formatting]
  if intercept && object.respond_to?(intercept)
    value = object.send(intercept, value, options)
  end
  ::Invoicing::CurrencyValue::Formatter.format_value(currency_of(object), value, options)
end