#include <stdlib.h>
char *gcvt(double value, int ndigit,
char *buf);
The gcvt() function converts a floating-point number
to a string. It converts value to a null-terminated string
(similar to that of the %g format of printf())
in the array pointed to by buf and returns buf.
It produces ndigit significant digits (limited to an unspecified
value determined by the precision of a double) in %f if possible,
or %e (scientific notation) otherwise. A minus sign is included
in the returned string if value is less than 0. A radix character is included
in the returned string if value is not a whole number.
Trailing zeros are suppressed where value is not a whole number.
The radix character is determined by the current locale.
- value
-
Is the floating point number to be formatted.
- ndigit
-
Is the number of significant digits.
- buf
-
Points to the array that is to hold the formatted data.
The gcvt() function always returns buf.
UNIX 98.
MT-Safe.
None.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- ecvt(), fcvt(), printf()
MKS Toolkit 9.3 Documentation Build 6.