What problems should be addressed when dealing with phone numbers?
thanks,
Ben
> What problems should be addressed when dealing with phone numbers?
If your application is only supposed to work in the north america area where
phone numbers all have 10 digits, it should be fairly easy to create a type
and a bunch of functions for it. Once you leave that area, however, you get
into all kinds of problems. While there is an international standard for
phone numbers, not every country supports it. There are countries where
phone numbers have a fixed but different number of digits (ie. different
than 10) and then there are also countries where the length of phone
numbers varies inside the country. Germany is a perfect example of that:
Phone numbers vary from 4 to 8 digits (last time I checked) plus area codes
that can be up to 5 digits long.
Handling international phone numbers consistently is an incredibly difficult
task which is why in the majority of cases phone numbers are just saved as
strings.
sm
If you are dealing with phone numbers in Australia, be aware that
they are of the form xxxx-xxxx, without the area code, which is only
two digits. Note that the rest of the number is -8- characters long.
Pone number formats are basically a dog's breakfast.
Oz