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 ...
Get The Rails™ 4 Way, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.