FORMAT

Description

Returns an expression formatted according to instructions contained in a format expression.

Syntax

FORMAT ( expression, format )

Parameter Description
expression Any valid expression.
format A valid named or user-defined format expression.

Remarks

Refer to the TEXT function for additional Format Symbols. Use FORMAT with STRIP on phone numbers and zip codes. Any of the following characters can be used to create a format expression for strings:

Character Description
@ Character placeholder. Display a character or a space.

If the string has a character in the position where the @ appears in the format string, display it; otherwise, display a space in that position.
& Character placeholder. Display a character or nothing. If the string has a character in the position where the & appears, display it; otherwise, display nothing.
< Force lowercase. Display all characters in lowercase format.
> Force uppercase. Display all characters in uppercase format.
! Force left to right fill of placeholders. The default is to fill placeholders from right to left.

Examples

FORMAT ( 5459.4, "##,##0.00" ) Returns "5,459.40".

FORMAT ( 5, "0.00%" ) Returns "500.00%".

FORMAT ( "HELLO", "<" ) Returns "hello".

See also

TEXT