FORMAT

Returns the formatted value of the input passed to the function.

Syntax

= FORMAT(value, formatString)

Parameters

value

A value which has to be formatted.  The number can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string with an optional currency symbol and separators (“1,234.56”, “$1,234.56”), as the value of a variable (e.g, UnitPrice), or as a Date.

formatString

A string which specifies how to format the value.  The string can be specified as a date formatter (e.g., “d”, “D”,  “f”, “F”), numeric format string (e.g., “c”, “d”, “e”, “f”, “g”), as a string with an optional currency symbol and separators (“1,234.56”, “$1,234.56”), as the value of a variable (e.g, UnitPrice), or as a Date.

Return Type

Object

Examples

Example

Returns

= FORMAT(“02/19/2009 14:30:30.3”, “d”)

2/19/2009

= FORMAT(ShippedDate, “d”)

The formatted value of ShippedDate in the Month Day format

= FORMAT(1234, “c”)

$1,234.00

= FORMAT(1234, “E”)

1.234000E+003