Formatting Phone Numbers – followup

The code which I originally put together on my previous blog entry was US centric…I have adjusted it to make it more flexible, and to be able to handle more countries.

The parameters have changed. 1) End users input 2) expected number of digits (after removing all other formatting) 3) Description of the target format (& denotes a substitution at that position. The single digit following an & denotes how many numbers to use from the phone number in that spot.

The full code can be downloaded from here

Calling the routine

Here is the code