Home | Previous Page | Next Page   Function Descriptions >

rfmtdec( )

The rfmtdec( ) function uses a formatting mask to convert a decimal value to a character string.

Syntax

int rfmtdec(dec_val, fmtstring, outbuf) 
   dec_t *dec_val;
   char *fmtstring;
   char *outbuf;
dec_val
is a pointer to the decimal value to format.
fmtstring
is a pointer to a character buffer that contains the formatting mask to use for the dec_val value.
outbuf
is a pointer to a character buffer to contain the formatted string for the dec_val value.

Usage

The fmtstring argument of the rfmtdec( ) function points to the numeric-formatting mask, which contains characters that describe how to format the decimal value.

Global Language Support

When you use rfmtdec( ) to format MONEY values, the function uses the currency symbols that the DBMONEY environment variable specifies. If you do not set this environment variable, rfmtdec( ) 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 IBM Informix: Guide to SQL Reference).

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

End of Global Language Support

Return Values

0
The conversion was successful.
-1211
The program ran out of memory (memory-allocation error).
-1217
The format string is too large.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]