| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== FORMAT (return formatted numbers into a picture) ====== | [[fontdialoga return chosen font and character set .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[forwardkey pass keystrokes to control.htm|{{btn_next_n.gif|Next page}}]] | | || **FORMAT(**//value//,//picture//**)** {{blk2blue.jpg|blk2blue.jpg}} | **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:** [[deformat return unformatted numbers from string .htm|DEFORMAT]] [[picture tokens.htm|Picture Tokens]]