1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/lib
Pan GaoYong 4e977da541 number_to_phone formats number with regexp
By default, this method formats US number. This commit extends its
functionality to format number for other countries with a custom regular
expression.

    number_to_phone(18812345678, pattern: /(\d{3})(\d{4})(\d{4})/)
    # => 188-1234-5678

The output phone number is divided into three groups, so the regexp
should also match three groups of numbers.
2016-04-02 20:13:22 +08:00
..
action_view number_to_phone formats number with regexp 2016-04-02 20:13:22 +08:00
action_view.rb Update copyright notices to 2016 [ci skip] 2015-12-31 18:27:19 +02:00