module ActionView::Helpers::NumberHelper

def number_with_delimiter(number, options = {})

number_with_delimiter("112a", raise: true) # => raise InvalidNumberError

# => 98 765 432,98
number_with_delimiter(98765432.98, delimiter: " ", separator: ",")
number_with_delimiter("112a") # => 112a
number_with_delimiter(12345678.05, locale: :fr) # => 12 345 678,05
number_with_delimiter(12345678.05, separator: " ") # => 12,345,678 05
number_with_delimiter(12345678, delimiter: ",") # => 12,345,678
number_with_delimiter(12345678, delimiter: ".") # => 12.345.678
number_with_delimiter(12345678.05) # => 12,345,678.05
number_with_delimiter("123456") # => 123,456
number_with_delimiter(12345678) # => 12,345,678

==== Examples

the argument is invalid.
* :raise - If true, raises +InvalidNumberError+ when
fractional and integer digits (defaults to ".").
* :separator - Sets the separator between the
to ",").
* :delimiter - Sets the thousands delimiter (defaults
(defaults to current locale).
* :locale - Sets the locale to be used for formatting

==== Options

hash.
(e.g., 12,324). You can customize the format in the +options+
Formats a +number+ with grouped thousands using +delimiter+
def number_with_delimiter(number, options = {})
  delegate_number_helper_method(:number_to_delimited, number, options)
end