Welcome, Guest. Please Login or Register
SAYNOTO0870.COM

<---- Back to main website

 
Home Help Search Login Register

Pages: 1 2 3 
Send Topic Print
UK Telephone Number Formats - 01x1 - 011x - 02x (Read 67,251 times)
catj
Senior Member
****
Offline



Posts: 366
UK Telephone Number Formats - 01x1 - 011x - 02x
Jun 6th, 2009 at 2:13pm
 

Is there any thought being given to fix the number lists such that numbers are returned in their correct format even if input in the wrong format?


That is, if the database contains a number like  0207   2343456  to show it on the website like   020  7234  3456  instead?


Taking "British Gas" as an example, and just the 01/02/03 column, there are three numbers in the wrong format in the 'main database' list and at least a further 30 in the wrong format in the 'unverified' list.

In many cases, there is multiple repetition, with e.g. 023 8005 1003 potentially being listed again as 0238 0051003 and 0238 005 1003 and 0238 0051 003 and 02380 051003 and 02380 051 003 and 02380051003. In this case, only 023 8005 1003 is the correct format.




The UK numbering system is quite complex. Here's a quick summary:


Local numbers can be 6 or 7 or 8 digits long.

The code can be 4 or 3 or 2 digits long, after the initial zero.


The area code and number is 11 digits in total, including initial zero.

There are very few exceptions.




Depending on the area code, the numbers are formatted in a very specific way, but it is one that is fairly easy to remember:


Birmingham (0121), Edinburgh (0131), Glasgow (0141), Liverpool (0151), Manchester (0161), Tyne and Wear/County Durham (0191):

Numbers with area code like (01x1) are written:   (01x1)  xxx  xxxx


Leeds (0113), Sheffield (0114), Nottingham (0115), Leicester (0116), Bristol (0117), Reading (0118):

Numbers with area code like (011x) are written:   (011x)  xxx  xxxx


London (020), Southampton and Portsmouth (023), Coventry (024), Northern Ireland (028), Cardiff (029):

Numbers with area code like (02x)  are written:   (02x)  xxxx  xxxx


Rest of the country (01xxx):

Numbers with area code like (01xxx) [but not including (01x1) or (011x) codes] are written:   (01xxx)  xxxxxx


There are a small number of exceptions where the number part has only 5 digits. These are usually written:   (01xxx)  xxxxx



The brackets around the area code are *optional*.



To summarise:

If the number starts 02x the number part is 8 digits long (grouped as  xxxx xxxx).

If the number starts 01x1 or 011x the number part is 7 digits long (grouped as  xxx xxxx).

Most other numbers are written 01xxx  xxxxxx (6-digit number), with a very few as 01xxx  xxxxx (5-digit number in very rural location).




It would require only a small number of 'regular expressions' to parse and fix the data so that it can be displayed in the Ofcom-approved format.


Back to top
« Last Edit: Jun 6th, 2009 at 4:05pm by catj »  
 
IP Logged
 
Dave
Global Moderator
*****
Offline



Posts: 9,902
Yorkshire
Gender: male
Re: UK Telephone number format
Reply #1 - Jun 6th, 2009 at 2:40pm
 
I agree catj, something needs to be done.

Numbers are stored in the database in the format they appear in the results. The search engine will only pick up on them if they are in the database in particular formats when searching by number (not company name). Extra spaces, spaces in some wrong places and brackets will mean that a number search won't return them.

There is currently no validation on the add number form, so numbers appear as they were entered. The first thing to do when any of us work on the database is to tidy up the formatting.

I hope that site admin will implement a fix for this. I agree with the spacings you suggest, other than I don't put spaces in the local part of numbers.
Back to top
 
 
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone number format
Reply #2 - Jun 6th, 2009 at 2:52pm
 
The programming for this is fairly simple. It will need a few value compares, and several regular expressions.

As you say, there's two things to consider here - the format the data is stored in, and the format that it is displayed in.
I'm somewhat surprised that it isn't normalised at the point it is stored in the database.



Off the top of my head I would:

- copy the number to a temporary variable in memory
- remove all the spaces and brackets and hyphens
- check that it is exactly 11 digits long.
- if it is not exactly 11 digits long then print it 'as is' [See Note 1]
- if it is exactly 11 digits long then run function(tidyup)
- this function would format the number correctly as per details above
- finally, print the number out

[1] Print 'as is' - as it is likely that it has extra punctuation, or maybe it is in international format, or might even be multiple numbers such as 0121 456 2345/6/7/8 or like 0121 5678 2340...2350 or some such.  I could live with a small number of items like this if the vast majority of other 'errors' were automatically cleaned up. In fact, in these cases, they would 'stick out more' in your listings making them higher priority for manual attention; you'd no longer need to work on most entries, as they would have automatically been 'tidied' by the operation above.



For the local number part, the 3-4 split for 7-digit numbers, and the 4-4 split for 8-digit numbers, is recommended by Ofcom for readability.  
I, for one, cannot accurately key in a number written like  01212521425  without error.
Back to top
« Last Edit: Jun 6th, 2009 at 3:09pm by catj »  
 
IP Logged
 
jgxenite
Supreme Member
*****
Offline


Help us to help you -
read the instructions!!

Posts: 1,454
Gender: male
Re: UK Telephone number format
Reply #3 - Jun 6th, 2009 at 3:03pm
 
These edits would all depend on Daniel, the site admin, having time to implement these changes. He is often busy and I don't believe he has much time to make (what could be considered) trivial updates.
Back to top
 

I don't mind helping you with your request as long as you read the instructions!
 
IP Logged
 
Dave
Global Moderator
*****
Offline



Posts: 9,902
Yorkshire
Gender: male
Re: UK Telephone number format
Reply #4 - Jun 6th, 2009 at 3:10pm
 
catj wrote on Jun 6th, 2009 at 2:52pm:
For the local number part, the 3-4 split for 7-digit numbers, and the 4-4 split for 8-digit numbers, is recommended by Ofcom for readability.  
I, for one, cannot accurately key in a number written like  01212521425  without error.

I know BT Phonebook website lists them in this format, although the printed directories do not.

If all the numbers were stored in the database without any spaces, the search engine could add them when it outputs its results. The add form would need to remove all spaces.
Back to top
 
 
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone number format
Reply #5 - Jun 6th, 2009 at 3:11pm
 
I'm not sure this is 'trivial'. The changes do sound like they would remove the need for some types of manual editing of the database, so it might be something that saves considerable admin time in the future. It would also (the prime reason for suggesting this) make the data a heck of a lot easier to read. It also sounds like it would help the number search function to work better - which might lead to less repetition of submission.

I'm torn between:
- tidying the number (with correct spacing) as it is stored (a one-time operation) and then displaying 'as is' when requested
- stripping spaces and brackets on all numbers as they are stored, and then formatting with spaces at display time (has to be done every time it is displayed).

In any case, there would need to be something on both input and output, simply because of the millions of existing entries already stored in the wrong format.
Back to top
« Last Edit: Jun 6th, 2009 at 3:22pm by catj »  
 
IP Logged
 
jgxenite
Supreme Member
*****
Offline


Help us to help you -
read the instructions!!

Posts: 1,454
Gender: male
Re: UK Telephone number format
Reply #6 - Jun 6th, 2009 at 3:15pm
 
As I've said, responsibility lies with Daniel to implement these changes, and I don't think it's something he's likely to do.
Back to top
 

I don't mind helping you with your request as long as you read the instructions!
 
IP Logged
 
Dave
Global Moderator
*****
Offline



Posts: 9,902
Yorkshire
Gender: male
Re: UK Telephone number format
Reply #7 - Jun 6th, 2009 at 5:21pm
 
catj wrote on Jun 6th, 2009 at 3:11pm:
I'm torn between:
- tidying the number (with correct spacing) as it is stored (a one-time operation) and then displaying 'as is' when requested
- stripping spaces and brackets on all numbers as they are stored, and then formatting with spaces at display time (has to be done every time it is displayed).

Some numbers are in the Other Information field, eg "Also: 01234 567890" and the search engine picks these up. If the number were to be stored without spaces, and they were to be added later, then there will be no way of being certain that it is a telephone number, although I suppose it will be unlikely to be anything else if it is 10 or 11 digits long starting 0.
Back to top
« Last Edit: Jun 6th, 2009 at 5:22pm by Dave »  
 
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #8 - Jun 6th, 2009 at 7:46pm
 
It wouldn't be a disaster if the stuff in the "other information" column was just left 'as-is'.

It's the readability of the other columns that's more important.
Back to top
 
 
IP Logged
 
Dave
Global Moderator
*****
Offline



Posts: 9,902
Yorkshire
Gender: male
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #9 - Jun 6th, 2009 at 8:15pm
 
catj wrote on Jun 6th, 2009 at 7:46pm:
It wouldn't be a disaster if the stuff in the "other information" column was just left 'as-is'.

It's the readability of the other columns that's more important.

The search engine currently picks up numbers with spaces in certain places. If numbers were stored in the database without any spaces, then it would not need to do it for them. It would, however, still need to search the Other Information field for numbers with spaces, just as it does now.
Back to top
 
 
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #10 - Jun 6th, 2009 at 8:23pm
 
I guess it all depends on what you do with a user's search query when received:
- search for what they typed exactly as they typed it,
- take all their spaces out and search for that,
- re-space it in the correct format for what they typed;

against what is in the database:
- numbers stored exactly as submitted,
- numbers stored as 10 or 11 digits with no spaces at all,
- numbers stored in the correct format for that area code.

There's several ways to achieve it, some more work than others.
Back to top
 
 
IP Logged
 
Forum Admin
YaBB Administrator
*****
Offline



Posts: 374
Gender: male
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #11 - Jun 7th, 2009 at 11:38am
 
Thanks for your post regarding the formatting of telephone numbers on the site.

This is something that I have been working on recently, and I am pleased to announce that this has now been implemented on the website. - At this time, this applies to all the telephone number columns, but does not apply to any numbers contained in the 'Other Info' column.

If you notice any anomalies please do not hesitate to let us know. - Either by posting a message on this thread, or via the 'Contact Us' link on the homepage.

Thanks again,
Daniel
(Forum Admin)
Back to top
 

Check Out the main website at http://www.saynoto0870.com
WWW  
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #12 - Jun 7th, 2009 at 11:44am
 
At first glance, that looks fantastic! I'll certainly keep an eye open for any errors. I'm sure they will be minor, if indeed there are any errors at all.

Thanks for taking the time out to make this great improvement to usability.  You also proved the single naysayer wrong. Smiley


I can live with the "other information" column using whatever format was typed by the user. The normal 'number' columns were the main problem.


Is it OK to submit test listings for company "TESTENTRY", or somesuch, or do you already have another made-up reserved word used for testing?
Back to top
« Last Edit: Jun 7th, 2009 at 11:48am by catj »  
 
IP Logged
 
Forum Admin
YaBB Administrator
*****
Offline



Posts: 374
Gender: male
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #13 - Jun 7th, 2009 at 11:51am
 
Yes, it is fine to test using a company name of 'Test'.

Thanks
Daniel
(Forum Admin)
Back to top
 

Check Out the main website at http://www.saynoto0870.com
WWW  
IP Logged
 
catj
Senior Member
****
Offline



Posts: 366
Re: UK Telephone Number Formats - 01x1 - 011x - 02
Reply #14 - Jun 7th, 2009 at 11:52am
 
On a number search for company 'BT', the words in the 'numbers' columns have oddsp acing in them, and/or the words are joine dtogether.

Words, and anything else non-numeric, need to be left 'as is' for display; only the all-digit entries, and only those that are exactly ten or eleven digits long, need to be formatted.

I guess that it is attempting to format them using the last formatting rule in your IF...ELSE list (and that one is probably '01xxx xxxxxx').

The clue is that the gap is after the fifth letter, every time.    Smiley



The formatting does not 'touch' numbers in the +441214789200 international format. That is not a problem.

There are too many issues with trying to fix those (you'd need to know the formatting rules for every country), and very very few are in that format anyway.
Back to top
« Last Edit: Jun 7th, 2009 at 2:10pm by catj »  
 
IP Logged
 
Pages: 1 2 3 
Send Topic Print
(Moderators: DaveM, bbb_uk, Forum Admin, Dave, CJT-80)

Website and Content © 1999-2024 SAYNOTO0870.COM. All Rights Reserved.
Written permission is required to duplicate any of the content within this site.

WARNING: This is an open forum, posts are NOT endorsed by SAYNOTO0870.COM,
please exercise due caution when acting on any info from here.


SAYNOTO0870.COM » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.


Valid RSS Valid XHTML Valid CSS Powered by Perl Source Forge