Wednesday, April 6, 2011

Helper method to display number in money format - number_with_delimiter

Examples

number_with_delimiter(12345678) # => 12,345,678
number_with_delimiter(12345678.05) # => 12,345,678.05
number_with_delimiter(12345678, :delimiter => ".") # => 12.345.678
number_with_delimiter(12345678, :separator => ",") # => 12,345,678
number_with_delimiter(12345678.05, :locale => :fr) # => 12 345 678,05
number_with_delimiter(98765432.98, :delimiter => " ", :separator => ",")

Source : http://apidock.com/rails/ActionView/Helpers/NumberHelper/number_with_delimiter

Learn :
Agile Web Development with Rails | Beginning Rails 3

No comments: