Is it better to store telephone numbers in some canonical format or “as entered”?

前端 未结 12 1515
鱼传尺愫
鱼传尺愫 2020-12-11 00:59

Storing a telehone number in some kind of canonical format has several advantages from a programmers point of view, but it might confuse the user, if sudde

12条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 01:51

    I usually like to store the number stripped and then format for display. Since I don't usually build application for use worldwide, I don't generally have to worry about the format. But in the case of an application for use all around the world, I would probably build a formatting module that formats according to the phone number's locale.

提交回复
热议问题