Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

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

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

Which is better memory and performance wise?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...