FORMAT Function

Returns the result of expression as a string formatted according to formatpicture.

Syntax

FORMAT(expression," formatpicture ")

Parameters

Name Required/Optional Data Type Description
expression
Required
String
A combination of constants, operators, functions, and references to ShapeSheet cells that results in a value.
formatpicture
Required
String
The format picture used to fomat the string.

Return value

String

Remarks

The type of the expression and the type specified in the format picture govern the behavior of the returned string. The formatpicture must be appropriate for the type of expression. For more information about specifying format pictures, see About format pictures.

Returns an error if the result of expression and the type expected in formatpicture are of a different kind or if there are syntax errors in formatpicture.

Example 1

FORMAT(1cm/4, "0.000 u")

Returns "0.250 cm."

Example 2

FORMAT(1cm/4, "0.00 U")

Returns "0.25 CM."

Example 3

FORMAT(1cm/4, "0.0 u")

Returns "0.3 cm."