Brad

If you run String on an alpha value it will not apply the format. Unlike 4D it doesn't barf if the argument is a string. I mention this because I tried this yesterday for a similar purpose and it didn't work.

If he stores the phone as a strictly numeric string, he may be able to coerce it to a number first.

$phone:=String(Num([table]phoneField);"(###) ###-####")

I didnt see part about storing the number in a string field until after I responded.

This whole thing can be easily handled by a simple 4D (or A4D) function which is how we actually do it in house.

<%=FormatPhone([table]phone;"714")%>

The function expects the value to be in a string field, we coerce inside the function (it does other things like applying an optional default area code (which is actually in a preference) or uses the optional second parameter which is the default area code.

This FormatPhone function is a dual purpose function which is used inside the 4D application as well.

Regards

Mike Erickson
Automated Solutions Group

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to