Handling Phone Numbers Formatting 
Author Message
 Handling Phone Numbers Formatting

I notice in Outlook, the phone number fields work great.  They format them
pretty good depending on what the user types in.

Is there a control that I can use that does that?  or does someone have a
suggestion on how to deal with the display and storage of phone numbers in
an application?

Thanks,
Gary



Thu, 13 May 2004 06:07:42 GMT  
 Handling Phone Numbers Formatting
It is pretty tricky to determine what a user meant from an
arbitrary input.  I worked out some schemes, but ended up
falling back to a simpler idea.  These suggestions are
predicated on the idea that I'm only going to store digits--no
formatting.

Formatting a string of phone digits:
1)  Strip out all non-digits.
2)  If it's 7 digits, format it as 000-0000
3)  If it's 10 digits, format it as 000-000-0000
4)  If it's 11 or more digits, format it as 000-000-0000, 0...
5)  Otherwise don't format.

This does not work very well for int'l numbers, but that chance
is wiped out by my original assumption.


Quote:
> I notice in Outlook, the phone number fields work great.  They
format them
> pretty good depending on what the user types in.

> Is there a control that I can use that does that?  or does
someone have a
> suggestion on how to deal with the display and storage of
phone numbers in
> an application?

> Thanks,
> Gary



Thu, 13 May 2004 07:57:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Handling Phone Numbers Formatting

2. microsoft outlook phone number formatting

3. Change Phone Number Format

4. Format phone number inside textbox control

5. format a phone number

6. formatting phone number

7. Formatting Phone Numbers

8. Format Phone Number

9. Format Phone number read from access database

10. phone number formatting

11. Formatting a Text Box for phone numbers

12. phone number format

 

 
Powered by phpBB® Forum Software