format

Use the format function to convert a number into a formatted textual representation according to the specified mask.

 format ( input; mask )

This function returns a value of type TEXT.

The function has two parameters:

  1. input, type NUMBER. The number to convert.
  2. mask, type TEXT. The formatting mask.

If the mask includes fractional digits, input is rounded to the nearest value with the specified precision. The mask must be sized to hold all integral digits.

Examples are provided here.

The 'ø' character has been used in the example to represent space characters. This character is not generated by the format function.

format (123.456; "Z,ZZZ.ZZ+") results in "øø123.46+"

format (-12345.67; "$B*,***,***.**BBDB") results in "£ø***12,345.67øøDB"

These symbols are explained in the next section.

The mask is language independent.

Output is formatted based on the current output language. The output has exactly the same number of characters as the mask (exception: "U").