C-Extensions / C API functions |
Converts a decimal value to a string value.
char *dececvt(dec_t *np, mint ndigit, mint *decpt, mint *sign);
You must specifying the length of the string in ndigit (the total number of digits).
The function rounds low-order digits.
A negative or zero value fordecpt means to the left of the returned digits.
If the sign of the result is negative, sign is nonzero; otherwise, sign is zero.
This function returns a pointer to the result string. This string is temporary and has to be copied into your own string buffer.