HP C/iX Library Reference Manual (30026-90004)
192 Chapter5
HP C/iX Library Function Descriptions
gcvt
gcvt
Converts floating-point numbers to strings.
Syntax
char *gcvt (double
value
, int
ndigit
, char *
buf
);
Parameters
value
The floating-point number to be converted to a character string.
ndigit
The number of digits to convert.
buf
A pointer to a character string containing the numeric string to be
formatted and to which the resulting formatted character string is
returned.
Return Values
x A pointer to a character array containing the resulting numeric character
string (the same as
buf
).
Description
The gcvt function converts the floating-point number in
value
into a signed numeric
character string. It attempts to produce
ndigit
significant digits in FORTRAN F-format if
possible; otherwise, E-format is used. A minus sign or decimal point is included as part of
the returned string. Trailing zeros are suppressed.
See Also
ecvt(), fcvt()