strLib.formatNumber

The string function strLib.formatNumber returns a number as a formatted string.


strLib.formatNumber syntax diagram

numericExpression

An expression that returns a numeric type, such as BIGINT, BIN, DECIMAL, FLOAT, INT, MONEY, NUM, NUMC, PACF, SMALLFLOAT or SMALLINT.

numericFormat

The value of numericFormat consists of a character string composed of a fixed set of control characters that define how the number is to be formatted, as described in the following table.

Control Character Meaning
* * fill character for leading zero.
& 0 fill character for leading zero.
# Blank fill for leading zero.
< Left justify number.
, Separator unless leading zero. The number when formatted contains the locale dependent separator.
. Decimal point. The number when formatted contains the locale dependent decimal point.
- Sign: - for <0; blank for >=0.
+ Sign: - for <0; + for >=0.
( Leading sign: ( for <0; blank for >=0. Specified in conjunction with ) for an accounting sign.
) Trailing sign: ) for <0; blank for >=0.
$ Leading currency symbol.
@ Trailing currency symbol.

Related reference
Text formatting (system words)