instance method
number_to_currency
Ruby on Rails edge
Signature
number_to_currency(number, options = {})
Delegates to ActiveSupport::NumberHelper#number_to_currency.
“‘ number_to_currency(“1234”) # => “$1234.00” “`
Additionally, supports a :raise option that will cause InvalidNumberError to be raised if number is not a valid number:
“‘ number_to_currency(“12x34”) # => “$12x34” number_to_currency(“12x34”, raise: true) # => InvalidNumberError “`
Parameters
-
numberreq -
optionsopt = {}
Source
# File actionview/lib/action_view/helpers/number_helper.rb, line 64
def number_to_currency(number, options = {})
delegate_number_helper_method(:number_to_currency, number, options)
end
Defined in actionview/lib/action_view/helpers/number_helper.rb line 64
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::NumberHelper