Forum Discussion
DavidJung
8 years agoQrew Assistant Captain
Here is my further improvement on this for "international format" using a QB phone-number field as a source. This strips out extensions, uses an international prefix if there is one, applies country code for North America.
If([Phone]<>"",
If(NotRight([Phone], "(")<>"","+"&Trim(NotRight([Phone], "(")),
Case([Country],
"United States","+1",
"","+1",
"Canada","+1",
"Mexico","+52",
"")))
&
Left((NotLeft([Phone], "(")),")")&
Right((NotRight([Phone], "-")),3)&
Right(
If(Contains([Phone],"x"),NotRight([Phone],"x"),[Phone]), "-")
)