rfmtdec()

Converts a decimal value to a string having a specified format.

Syntax

int rfmtdec(dec_t *dec, char *format, char *outbuf);
  1. dec is a pointer to the decimal value to format.
  2. format is a pointer to a character buffer that contains the formatting mask to use.
  3. outbuf is a pointer to a character buffer that receives the resulting formatted string.

Returns

Table 1. Return codes
Code Description
0 The conversion was successful.
<0 The conversion failed.
-1211 The program ran out of memory (memory-allocation error).
-1217 The format string is too large.