Skip to content

Commit a9a9336

Browse files
authored
Merge pull request rails#52275 from kabirpathak/update-doc-for-number-helper-in-active-support
[ci skip] Added usage documentation for ActiveSupport::NumberHelper.
2 parents 1264452 + 126cab3 commit a9a9336

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

activesupport/lib/active_support/number_helper.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# frozen_string_literal: true
22

33
module ActiveSupport
4+
# = Number Helper
5+
#
6+
# Provides methods for formatting numbers into currencies, percentages,
7+
# phone numbers, and more.
8+
#
9+
# Example usage in a class:
10+
# class Topic
11+
# include ActiveSupport::NumberHelper
12+
#
13+
# def price
14+
# number_to_currency(@price)
15+
# end
16+
# end
17+
#
18+
# Example usage in a module:
19+
# require "active_support/number_helper"
20+
#
21+
# module NumberFormatting
22+
# def format_price(price)
23+
# ActiveSupport::NumberHelper.number_to_currency(price)
24+
# end
25+
# end
426
module NumberHelper
527
extend ActiveSupport::Autoload
628

0 commit comments

Comments
 (0)