This project is archived and is in readonly mode.

#1236 ✓wontfix
Tim Morgan

Add 'groupings' option to number_to_phone helper

Reported by Tim Morgan | October 19th, 2008 @ 11:57 PM | in 2.x

This will allow the method to handle many more countries. For example, mobile phones in Australia use the format "0412 345 678" and landlines use the format "(02) 1234 5678". The 'groupings' option makes generating these formats possible:

number_to_phone('0212345678', :groupings => [2, 4, 4], :area_code => true, :delimiter => " ") # => (02) 1234 5678

number_to_phone('0412345678', :groupings => [4, 3, 3], :delimiter => " ") # => 0412 345 678

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages