Module: L10n::CoreExtensions::NumericExt::Formatting

Defined in:
lib/l10n/core_extensions/numeric_ext.rb

Instance Method Summary collapse

Instance Method Details

#to_localized_formatted_s(format = :rounded, options = nil) ⇒ Object Also known as: to_lfs



29
30
31
32
33
34
35
36
37
# File 'lib/l10n/core_extensions/numeric_ext.rb', line 29

def to_localized_formatted_s(format = :rounded, options = nil)
  if options.nil? && format.is_a?(Hash)
    options = format
    format = :rounded
  end
  options ||= {}
  options[:locale] ||= I18n.locale
  to_fs(format, options)
end