STR() Function - BBj

For this topic's original documentation, see STR() Function - Numeric to String Conversion with String Masking.

BBj-Specific Information

Syntax

STR(objexpr{:mask}{,ERR=lineref})

Description

In BBj, the STR() function accepts arguments of any type. If the argument evaluates to a number, STR(num) is used, otherwise STR(str) is used. BBj STR() function supports the 'U' mask character.

Examples

>X!=123
>PRINT STR(X!:"0000"); REM ' numeric masking
0123
>X!=52.3
>PRINT STR(X!); REM ' convert number to string
52.3
>X!=3352.3
>PRINT STR(X!:"$##,##0.00"); REM ' numeric masking
$3,352.30
>X!="abcdefg"
>PRINT STR(X!:"XX-XXX-XX"); REM ' string masking
ab-cde-fg
>X!=new java.lang.Integer(123)
>PRINT STR(X!:"00-00"); REM ' string masking
12-3

>

See Also

Functions - Alphabetical Listing