电话号码应该是字符串,还是可以存储电话号码的某些数字类型? [英] phone number should be a string or some numeric type that have capacity to save phone number?

查看:259
本文介绍了电话号码应该是字符串,还是可以存储电话号码的某些数字类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们要存储10位手机号码,即9999999999.它应该是数字还是字符串数据类型?我们不想对此进行任何计算或操纵操作

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?

推荐答案

ITU-T建议E. 164 说,国家/地区拨号计划中的国家/地区代码需要3位数字,而电话号码最多需要15位数字.

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是北美号码.也可以渲染 (212)555-1212在北美为中心的应用中.

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

32个字符的文字应该可以在全世界范围内发挥作用.

32 characters of text should do the trick worldwide.

请勿使用数字,否则您将感到抱歉.我当时是:两件事.

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

  • 因为我们假设所有电话号码均符合NanP标准,所以该公司在欧洲失去了一些业务十位数字.
  • 电子表格导出结果以科学计数法表示数字2.12555E+09这几乎就像SIRI告诉我的一样您打来的电话是来自两十亿一千二百万的电话... .
  • 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.

这篇关于电话号码应该是字符串,还是可以存储电话号码的某些数字类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆