SoftadminUtil.PhoneNumber_FormatAsE123

Type: Scalar function

This function takes a phone number and formats it in accordance with world standard ITU-T E.123.
If the supplied phone number has a leading plus (+) character then the number will be formatted as an international number, otherwise as a national number.

If a default country code is supplied then all numbers will be formatted as international numbers regardless of original format.

Note: Only phone numbers deemed valid by the function SoftadminUtil.PhoneNumber_IsValid are guaranteed to be formatted correctly.

Return value: varchar(50)

A formatted phone number.

Parameters

@PhoneNumber mandatory varchar(50)
The phone number to format.
@DefaultCountryCode optional varchar(10)
Formats all phone numbers as international phone numbers and adds this country code if a country code is not specified in the phone number. If not specified mumbers without a country code will be formatted as a local phone number.