提交 7a27de2b 编写于 作者: R Robin Dupret

Tiny documentation improvements [ci skip]

上级 ac1c888b
......@@ -31,8 +31,9 @@ module ActiveModel
# of the attributes hash's keys. In order to override this behavior, take a look
# at the private method +read_attribute_for_serialization+.
#
# JSON Serialization module is automatically include the <tt>ActiveModel::Serialization</tt>
# module, so there is no need to explicitly include it.
# The JSON serialization is provided by default when you include the
# <tt>ActiveModel::Serialization</tt> module, so there is no need to explicitly
# include it.
#
# A minimal implementation including JSON would be:
#
......
......@@ -136,8 +136,8 @@ def number_to_percentage(number, options = {})
# * <tt>:separator</tt> - Sets the separator between the
# fractional and integer digits (defaults to ".").
# * <tt>:delimiter_pattern</tt> - Sets a custom regular expression used for
# for deriving, the placement of delimiter. Helpful when using currency
# formats like INR.
# deriving the placement of delimiter. Helpful when using currency formats
# like INR.
#
# ==== Examples
#
......@@ -150,9 +150,10 @@ def number_to_percentage(number, options = {})
# number_to_delimited(12345678.05, locale: :fr) # => 12 345 678,05
# number_to_delimited('112a') # => 112a
# number_to_delimited(98765432.98, delimiter: ' ', separator: ',')
# number_helper.number_to_delimited("123456.78",
# delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/) # => 1,23,456.78
# # => 98 765 432,98
# # => 98 765 432,98
# number_to_delimited("123456.78",
# delimiter_pattern: /(\d+?)(?=(\d\d)+(\d)(?!\d))/)
# # => 1,23,456.78
def number_to_delimited(number, options = {})
NumberToDelimitedConverter.convert(number, options)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册