The rfmtlong() function

The rfmtlong() function uses a formatting mask to convert a C long value to a character string.

Syntax

mint rfmtlong(lng_val, fmtstring, outbuf)
   int4 lng_val;
   char *fmtstring;
   char *outbuf;
lng_val
The int4 integer to convert to a character value.
fmtstring
A pointer to a character buffer that contains the formatting mask for the value in lng_val.
outbuf
A pointer to a character buffer to contain the formatted string for the value in lng_val.

Usage

The fmtstring argument of the rfmtlong() function points to the numeric-formatting mask, which contains characters that describe how to format the long integervalue.

When you use rfmtlong() to format MONEY values, the function uses the currency symbols that the DBMONEY environment variable specifies. If you do not set this environment variable, rfmtlong() uses the currency symbols that the client locale defines. The default locale, U.S. English, defines currency symbols as if you set DBMONEY to ‘$,.’. (For a discussion of DBMONEY, see the HCL OneDB™ Guide to SQL: Reference.)

When you use a nondefault locale that has a multibyte code set, rfmtlong() supports multibyte characters in the format string. For more information, see the HCL OneDB GLS User's Guide.

Return values

0
The conversion was successful.
-1211
The program ran out of memory (memory-allocation error).
-1217
The format string is too large.