# Telephone number validation and formatting

**URL:** <https://www.ruby-forum.com/t/telephone-number-validation-and-formatting/177158>\
**Category:** Rails I18n\
**Created:** [October 12, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/telephone-number-validation-and-formatting/177158 "2009-10-12T17:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raffil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/65b543/32.png) [@raffil](https://www.ruby-forum.com/u/raffil)\
**Post date:** [October 12, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/telephone-number-validation-and-formatting/177158/1 "2009-10-12T17:22:55Z")

</div>

I’m working to build a telephone number validation and formatting  
method.  
I’m attaching an address\_helper I use for this.  
I’d like to get comments on it.  
The method is based on extending the country model by adding 4 integer  
attributes: tel\_min, tel\_max, tel\_area\_min and tel\_area\_max which are  
the minimum and maximum number of digits of the telephone number in each  
country and the minimum and maximum number of digits in the telephone  
area code.  
Please comment.  
Thanks,  
Raffi
