1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Tiny documentation improvements [ci skip]

This commit is contained in:
Robin Dupret 2015-08-28 15:33:48 +02:00
parent ac1c888b95
commit 7a27de2bb0
2 changed files with 9 additions and 7 deletions

View file

@ -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:
#

View file

@ -136,8 +136,8 @@ module ActiveSupport
# * <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 @@ module ActiveSupport
# 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