Navigation: Language Reference > 13 - Built-in Functions >====== FORMAT (return formatted numbers into a picture) ====== | |
FORMAT(value,picture)
FORMAT | Returns a formatted string. |
value | A variable or expression for the value to be formatted. |
picture | A picture token, or the label of a STRING variable or expression containing a picture token. |
The FORMAT procedure returns a string formatted according to the picture parameter.
Return Data Type: | STRING |
Example:
!Format the Social Security number:
Rpt:SocSecNbr = FORMAT(Emp:SSN,@P###-##-####P)
!Change phone format from dashes to parenthesis:
Phone = FORMAT(DEFORMAT(Phone,@P###-###-####P),@P(###)###-####P)
!Format a date as a string:
DateString = FORMAT(DateLong,@D1)
See Also: