FORMAT
Top  Previous  Next

(FORMAT (value,'picture-format'))

Prints picture formats to a variable, rather than only to the screen. You can use FORMAT anywhere that you can use a function. The result of the FORMAT function is always text.

In the syntax for this function, value is the value you want to be displayed in a particular format; it can be a column, variable, or a constant value. 'Picture-format' is the picture format you establish.

The FORMAT function can be useful in several ways:

·   Aligning decimals  
·   Punctuating long numbers  
·   Formatting currency  
·   Formatting text  

The characters you can use to format your data are listed below.

For All Data
[<]
Data is left justified.
[>]
Data is right justified.
[^]
Data is centered.


For Numbers
[-]
Places a minus sign to the right of a negative number.
[DB]
Places DB to the right of a negative number.
[( )]
Encloses a negative number in parentheses.
[CR]
Places CR to the right of a positive number.
9
Fills unused space with blanks.
0
Fills unused space with zeros.
*
Fills unused space with asterisks.


For Text
_
Letters are uppercase; other characters are blank.
|
Letters are lowercase; other characters are blank.   
%
Letters are uppercase; other characters are unchanged.
?
Letters are lowercase; other characters are unchanged.