mirror of https://github.com/rails/rails
[ci skip] Added usage documentation for ActiveSupport::NumberHelper.
This commit is contained in:
parent
4fa56814f1
commit
126cab3af7
|
@ -1,6 +1,28 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveSupport
|
||||
# = Number Helper
|
||||
#
|
||||
# Provides methods for formatting numbers into currencies, percentages,
|
||||
# phone numbers, and more.
|
||||
#
|
||||
# Example usage in a class:
|
||||
# class Topic
|
||||
# include ActiveSupport::NumberHelper
|
||||
#
|
||||
# def price
|
||||
# number_to_currency(@price)
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# Example usage in a module:
|
||||
# require "active_support/number_helper"
|
||||
#
|
||||
# module NumberFormatting
|
||||
# def format_price(price)
|
||||
# ActiveSupport::NumberHelper.number_to_currency(price)
|
||||
# end
|
||||
# end
|
||||
module NumberHelper
|
||||
extend ActiveSupport::Autoload
|
||||
|
||||
|
|
Loading…
Reference in New Issue