### Title

Adding dashes to telphone numbers

### Post

Hi:

I'm new to FM. I searched the entire forum, but didn't find a solution. I currently have telephone numbers in a field called Phone_work. The numbers display as 10 digit numbers with no characters. I would like to reformat all the numbers, without retyping them, to this format ###-###-####. I did a find all and thought of doing a replace field contents with a calculated result, but I have no clue what is the right script.

Your help is greatly appreciated.

DPG

I think this might do it:

Let

(P1_phone = Filter(Table::Field ;"0123456789");

Left ( P1_phone_H ;3 ) &"-"& Middle ( P1_phone_H ; 7 ; 3 ) & "-" & Right (P1_phone_H ; 4 )

)

To make it portable, you can create it as a custom function. If the function was called cf_PhoneFormat, you could make the parameter PhoneNumber (instead of the Table::Field) and in the Auto Enter Tab, select Calculated value > Specify Calculation:

cf_PhoneFormat (Self)