in reply to Re: formatted phone number from variable
in thread formatted phone number from variable

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)

  • Comment on Re: Re: formatted phone number from variable

Replies are listed 'Best First'.
Re: Re: Re: formatted phone number from variable
by htoug (Deacon) on May 23, 2003 at 06:05 UTC
    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.