FMT Function

Applies formatting to a string.

Syntax

FMT(source, format)

Syntax Elements

source An expression that evaluates to the string to which the formatting is to be applied.

format A string specifying the required formatting.

Return Value

The modified string.

Operation

The FMT function provides an alternative way of applying a format string. For example, the following statements produce the same result:

PRINT 1000 "R$,2#9"
PRINT FMT(1000, "R$,2#9")

See Also

OCONV function.

Example

A = "ABC"
B = FMT(A, 'MCAX')
PRINT B

This prints 414243 (MCAX converts ASCII characters to their hex values).