FORMATEX function

Microsoft Office ShapeSheet

FORMATEX function

Returns the result of expression evaluated in inputunit as a string formatted according to formatpicture expressed in outputunit.

Syntax

FORMATEX(expression,"formatpicture"[,inputunit][,outputunit])

expression

A combination of constants, operators, functions, and references to ShapeSheet cells that results in a value.

inputunit

Optional. A numerical value or valid abbreviated unit of measure (in, in., inch, etc.).

outputunit

Optional. A numerical value or valid abbreviated unit of measure (in, in., inch, etc.).

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.

inputunit is used to scale untyped expression results, such as 3 + 4. If the result of expession has an explicit type, such as 3 ft + 8 ft, then inputunit is ignored.

outputunit is used to specify the units used for the formatted result. If outputunit is not specified, the units for the result of the expression are used.

Returns an error if the result of expression and the type expected in formatpicture are of a different kind, if there are syntax errors in formatpicture, or if it does not recognize the units passed as inputunits or outputunits.

Example

FORMATEX(5.5, "0.00 u", "cm", "ft")

Returns 0.18 ft.