FORMAT (return formatted numbers into a picture)

Top  Previous  Next

 

FORMAT(value,picture)

FORMAT

Returns a formatted numeric string.

value

A numeric 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 numeric 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:

DEFORMAT

Picture Tokens