phone number should be a string or some numeric type that have capacity to save phone number?

前端 未结 4 1477
忘了有多久
忘了有多久 2021-01-01 23:09

We want to store 10 digit mobile number i.e.9999999999. Should it be numeric or string datatype? We don\'t want to do any calculative or manipulation operation on this

4条回答
  •  别那么骄傲
    2021-01-01 23:32

    ITU-T recommendation E.164 says you need 3 digits for the country code and up to 15 digits for the directory number within the country dialing plan.

    And, many people add some punctuation. For example:

    +1.212.555.1212 is a North American number. It could also be rendered (212) 555-1212 in a North American centric app.

    32 characters of text should do the trick worldwide.

    DO NOT use a number, or you'll be sorry. I was: two things.

    • Lost some European business for a company because we assumed all phone numbers were NANP-compliant ten-digit numbers.
    • A spreadsheet export rendered the numbers in scientific notation 2.12555E+09 That's almost as stupid as SIRI telling me you have call from two bllion, one hundred twenty five million....

    Telephone directory numbers are not numeric data types. Take a look at this: Falsehoods Programmers Believe About Telephone Numbers.

提交回复
热议问题