Not that it's always right, but Google's libphonenumber has formatting rules for phone numbers that work pretty well. But you need to know the right country, which isn't always easy; people may enter a local number and the site context isn't always enough to know what country is implied.
Comments
Not that it's always right, but Google's libphonenumber has formatting rules for phone numbers that work pretty well. But you need to know the right country, which isn't always easy; people may enter a local number and the site context isn't always enough to know what country is implied.