12 lines
253 B
Go
12 lines
253 B
Go
package ysphone
|
|
|
|
import "github.com/nyaruka/phonenumbers"
|
|
|
|
func FormatPhoneNumber(phoneNumber string) string {
|
|
if phoneNumber == "" {
|
|
return ""
|
|
}
|
|
num, _ := phonenumbers.Parse(phoneNumber, "CN")
|
|
return phonenumbers.Format(num, phonenumbers.E164)
|
|
}
|