Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: formatted phone number from variable

by htoug (Deacon)
on May 22, 2003 at 14:12 UTC ( [id://260065]=note: print w/replies, xml ) Need Help??


in reply to formatted phone number from variable

That has been discussed a number of times on perlmonks before.
Using Super Search with the words 'phone', 'number' and 'format' gave me an enormous number of hits. I was looking for this node, where there is a good analysis of the problem - and a discussion of the formatting of numbers from different countries.
You are seeking a too simple solution to the problem - and could have used Super Search to find a solution to a more complete problem.
  • Comment on Re: formatted phone number from variable

Replies are listed 'Best First'.
Re: Re: formatted phone number from variable
by hossman (Prior) on May 23, 2003 at 02:27 UTC

    While i agree with your suggestion to allways Super Search first...

    Just because there is a more complete problem, doesn't mean a person is interested in a solution to the complete problem -- in many cases the problems people face are simple subsets of larger "complete" problems.

    Regardless of the posters subject, it was very clear that the input would be "1234567890" and the desired output was "(123) 456-7890"

    If I was in a situation like that, where I knew my input would be limited to exactly 10 digits, with no punctuation, and i found node#159645 ... i would consider it severe overkill, and ask the question anyway. (Because I don't care about the obscure phone number rules of various countries ... i care about formating 10 digits)

      This was just my attempt to point out that what may superficially seem to be a simple problem, in fact is not.

      Formatting phone numbers is not simple.
      Formatting 10 digit numbers is simple though.

      The poster did specifically mention phone number in the node, so I took the chance to point out that he might be tackling a problem quite a bit larger than he originally intended. You do have to remember that there is a world outside your local pond, and sometimes it can crawl up on you and disturb your nice schemes.

      If (and only if) you are certain that all the phone numbers you will have to work with (now and in the future) are exactly 10 digits, then the 10 digit formatting assumption holds. I just don't think that the assumption holds - as my phone number is just 8 digits.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://260065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found