O'Reilly logo

The Rails™ 4 Way, Third Edition by Kevin Faustino, Obie Fernandez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.13.0.6 number_with_delimiter(number, options = {})

Formats a number with grouped thousands using a delimiter. You can customize the format in the options hash.

:locale Sets the locale to be used for formatting. Defaults to current locale.

:delimiter Sets the thousands delimiter. Defaults to ",".

:separator Sets the separator between the units. Defaults to ".".

:raise Setting to true raises InvalidNumberError when the number is invalid.

1 number_with_delimiter(12345678)                 # => "12,345,678"2 number_with_delimiter(12345678.05)              # => "12,345,678.05"3 number_with_delimiter(12345678, delimiter: ".") # => "12.345.678"

11.13.0.7 number_with_precision(number, options = {})

Formats a number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required