I am trying to format a string phone number field from the current xxx-xxx-xxxx format to (xxx) xxx-xxxx.
I reviewed the posts in threat 767-608674 but I am not able to get the suggested formulas to work. This is what I have now:
stringvar fmtPhone;
replace(replace(replace(replace({TABLE.PHONE},"(", ""), ")", ""), "-", ""), " ", "");
"(" & left(fmtPhone, 3) & ") " & mid(fmtPhone, 4, 3) & "-" & mid(fmtPhone, 7, 4)
The result returns only the formatting, not the formatted field: Example:
() -
I also tried this:
StringVar fmtPhone;
fmtPhone = Replace( {TABLE.PHONE}, "(", "" );
fmtPhone = Replace( fmtPhone, ")", "" );
fmtPhone = Replace( fmtPhone, "-", "" );
fmtPhone = Replace( fmtPhone, " ", "" );
"(" & left(fmtPhone, 3) & ") " & mid(fmtPhone, 4, 3) & "-" & mid(fmtPhone, 7, 4) ;
with the same result.
anyone have any feedback for how to make these formulas work? Thanks!
I reviewed the posts in threat 767-608674 but I am not able to get the suggested formulas to work. This is what I have now:
stringvar fmtPhone;
replace(replace(replace(replace({TABLE.PHONE},"(", ""), ")", ""), "-", ""), " ", "");
"(" & left(fmtPhone, 3) & ") " & mid(fmtPhone, 4, 3) & "-" & mid(fmtPhone, 7, 4)
The result returns only the formatting, not the formatted field: Example:
() -
I also tried this:
StringVar fmtPhone;
fmtPhone = Replace( {TABLE.PHONE}, "(", "" );
fmtPhone = Replace( fmtPhone, ")", "" );
fmtPhone = Replace( fmtPhone, "-", "" );
fmtPhone = Replace( fmtPhone, " ", "" );
"(" & left(fmtPhone, 3) & ") " & mid(fmtPhone, 4, 3) & "-" & mid(fmtPhone, 7, 4) ;
with the same result.
anyone have any feedback for how to make these formulas work? Thanks!