DataBasic Reference > Statements and Intrinsic Functions > F > FMT Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

FMT Function (DataBasic) (m618703+fmt_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

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).

RealityV15.1 (MoTW) Revision 7Comment on this topic