Guardian C Library Calls Reference Manual

ecvt (supplementary)
3-26 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
ecvt (supplementary)
The ecvt function converts a numeric value to a string.
value
is the value to convert.
ndig
is the number of digits in the converted string. Because the converted string does not
include a sign or a decimal point, ndig does not include them in its count of digits.
dec
points to the variable of type int where ecvt stores the position of the decimal point
relative to the beginning of the string. A negative value indicates that the decimal
point is to the left of the first digit.
sign
points to the variable of type int where ecvt stores the sign. A nonzero value
indicates a negative result; the value zero indicates a positive result.
Return Value
is a pointer to the converted string.
Usage Guidelines
*dec indicates where in the return string the decimal point should appear. The string
itself does not include the decimal-point character.
The ecvt function returns a pointer to static data within the function. Consequently,
the content of the returned string changes with each call to ecvt.
#include <stdlibh>
char *ecvt(double value, short ndig, short *dec, short *sign);