I noticed that my iPhone formats phone numbers perfectly. For example the phone number "441219999999" should be formatted as "0121 999 9999" but the number "441606999999" should be "01606 999 999", this is because 0121 is the area code for Birmingham and because it has a large customer base it has 7 digits reserved for numbers rather than 6, whereas 01606 is an area code for a town in Cheshire which only need 6 digits for the number.
...and that's just for UK numbers.
I was wondering if anyone had developed a database of representations for phone numbers given their content (so normalised phone numbers starting with "1" for the USA would be subject to different formatting rules compared to the UK's 44). It would also need to store details on how area codes can have different lengths. And so on.
Add your 2¢