.TH ECVT 3 .CT 2 data_man .SH NAME ecvt, fcvt, gcvt \- convert numbers to ascii .SH SYNOPSIS .nf .B char *ecvt(value, ndigit, decpt, sign) .B double value; .B int ndigit, *decpt, *sign; .PP .B char *fcvt(value, ndigit, decpt, sign) .B double value; .B int ndigit, *decpt, *sign; .PP .B char *gcvt(value, ndigit, buf) .B double value; .B char *buf; .fi .SH DESCRIPTION .I Ecvt converts the .I value to a null-terminated string of .I ndigit ASCII digits and returns a pointer thereto. The position of the decimal point relative to the beginning of the string is stored indirectly through .IR decpt "" (negative means to the left of the returned digits). If the sign of the result is negative, the word pointed to by .IR sign "" is non-zero, otherwise it is zero. The low-order digit is rounded. .PP .I Fcvt is similar to .I ecvt and produces output for the Fortran format .BI F*. ndigit . If .IR decpt \(<=\- ndigit , then the returned string is null. Otherwise, .IR decpt + ndigit +1 characters (including terminating null) are returned. .PP .I Gcvt converts the .I value to a null-terminated ASCII string in .I buf and returns a pointer to .I buf. It attempts to produce .I ndigit significant digits in Fortran F format if possible, otherwise E format, ready for printing. Trailing zeros may be suppressed. .SH "SEE ALSO" .IR printf (3) .SH BUGS The return values point to static data whose content is overwritten by each call.