method

number_with_delimiter

rails latest stable - Class: ActionView::Helpers::NumberHelper
number_with_delimiter(number, options = {})
public

Delegates to ActiveSupport::NumberHelper#number_to_delimited.

Additionally, supports a :raise option that will cause InvalidNumberError to be raised if number is not a valid number:

number_with_delimiter("12x34")              # => "12x34"
number_with_delimiter("12x34", raise: true) # => InvalidNumberError

2Notes

Alternative: use 1000.humanize

grosser · Oct 25, 20082 thanks
1.humanize == “1″
1000000.humanize == “1.000.000″
1000.12345.humanize == “1.000,12″

http://pragmatig.wordpress.com/2008/10/25/numbers-for-humans-humanize-for-numeric/

Deprecation warning for old-style options

tadman · Apr 9, 2009

You will get a warning if you don't define your separators as a hash:

DEPRECATION WARNING: number_with_delimiter takes an option hash instead of separate delimiter and precision arguments

So while you can still use that style, it's not without a scolding.