The formatphone( function formats a US phone number using the standard (aaa) nnn-nnnn format.
Parameters
This function has one parameter:string – The phone number to be formatted.
Description
This function formats a US phone number using the standard (aaa) nnn-nnnn format.
formatphone("310-555-1212") ☞ (310) 555-1212
formatphone("8003481245") ☞ (800) 348-1245
Note: This function is equivalent to:
?(length(striptonum(string))=10,"("+striptonum(string)[1,3]+") "+striptonum(string)[4,6]+"-"+striptonum(string)[7,10],?(length(striptonum(string))=7,striptonum(string)[1,3]+"-"+striptonum(string)[4,7],string))
See Also
History
Version | Status | Notes |
10.0 | No Change | Carried over from Panorama 6.0. |