Why is it best to store a telephone number as a string vs. integer?

前端 未结 5 633
死守一世寂寞
死守一世寂寞 2021-02-01 12:50

As the question states, why is it considered best practice to store telephone numbers as strings rather than integers in the telephone_number column?

Not sure I understa

5条回答
  •  你的背包
    2021-02-01 13:23

    Consider these phone numbers for example

    099-1234-56789 or +91-8907-687665.

    In this case,if the phone_number attribute is of type integer,then it can't accept these values.It should be a string to hold these type of values.So string is always preferred than integer

提交回复
热议问题