Tolkin, Steve [[EMAIL PROTECTED]] quoth:
*>If in fact users are entering the phone numbers you will want to do a much
*>better
*>job than this.
*>perople may or may not put the 1 in front of 800 etc., Letters are often
*>used for phone numbers, and there maybe be an extension indicated e.g.
*>1-800-mattress [sic -- there are often "extra" letters that don't matter]  
*>555-1234 ext 666 == 555-1234x666 etc. will would be reformatted to
*>555-123-4666

That wouldn't be too impossible to write an algorithm to add a leading 1
since, as I recall, no US area codes begin with 1. Once that is added, you
can map the letters to digits and strip off the 'extras'. And, if it is an
input form on the web, one can also add field limits and extra fields for
xtensions and the like.

*>This is only for the U.S. -- international numbers make it even more
*>complex.

Americans have, for a long time, been able to ignore the rest of the world
in things such as this but soon I think it will mean a loss of business if
we do. The system is a little different but not really terribly complex.
You have a country code, a city code and a 6-7 digit phone number. There
is no standard though and you'd probably have to store templates for each
country.

However, this is much like formatting names for people, there is always
going to be an exception.

e.

Reply via email to