mirror of https://github.com/rails/rails
Add missing documentation options to number_to_currency [ci skip]
This commit is contained in:
parent
4a65dfcb9a
commit
6e1a536ad4
|
@ -100,6 +100,9 @@ module ActionView
|
|||
# absolute value of the number.
|
||||
# * <tt>:raise</tt> - If true, raises +InvalidNumberError+ when
|
||||
# the argument is invalid.
|
||||
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
||||
# insignificant zeros after the decimal separator (defaults to
|
||||
# +false+).
|
||||
#
|
||||
# ==== Examples
|
||||
#
|
||||
|
@ -117,6 +120,8 @@ module ActionView
|
|||
# # => R$1234567890,50
|
||||
# number_to_currency(1234567890.50, unit: "R$", separator: ",", delimiter: "", format: "%n %u")
|
||||
# # => 1234567890,50 R$
|
||||
# number_to_currency(1234567890.50, strip_insignificant_zeros: true)
|
||||
# # => "$1,234,567,890.5"
|
||||
def number_to_currency(number, options = {})
|
||||
delegate_number_helper_method(:number_to_currency, number, options)
|
||||
end
|
||||
|
|
|
@ -85,6 +85,9 @@ module ActiveSupport
|
|||
# number given by <tt>:format</tt>). Accepts the same fields
|
||||
# than <tt>:format</tt>, except <tt>%n</tt> is here the
|
||||
# absolute value of the number.
|
||||
# * <tt>:strip_insignificant_zeros</tt> - If +true+ removes
|
||||
# insignificant zeros after the decimal separator (defaults to
|
||||
# +false+).
|
||||
#
|
||||
# ==== Examples
|
||||
#
|
||||
|
@ -100,6 +103,8 @@ module ActiveSupport
|
|||
# # => "£1234567890,50"
|
||||
# number_to_currency(1234567890.50, unit: '£', separator: ',', delimiter: '', format: '%n %u')
|
||||
# # => "1234567890,50 £"
|
||||
# number_to_currency(1234567890.50, strip_insignificant_zeros: true)
|
||||
# # => "$1,234,567,890.5"
|
||||
def number_to_currency(number, options = {})
|
||||
NumberToCurrencyConverter.convert(number, options)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue