In the following sections, we will work through a complete example on formatting telephone numbers. Formatting telephone numbers involves local conventions that vary from culture to culture. For example, the same US phone number can have all of the formats listed below:
754-3010 | Local |
(541) 754-3010 | Domestic |
+1-541-754-3010 | International |
1-541-754-3010 | Dialed in the US |
001-541-754-3010 | Dialed from Germany |
191 541 754 3010 | Dialed from France |
Now consider a German phone number. Although a German phone number consists of an area code and an extension like a US number, the format is different. Here is the same German phone number in a variety of formats:
636-48018 | Local |
(089) / 636-48018 | Domestic |
+49-89-636-48018 | International |
19-49-89-636-48018 | Dialed from France |
Note the difference in formatting domestic numbers. In the US, the convention is 1 (area code) extension, while in Germany it is (0 area code)/extension.