gcvtf---format double or float as string
#include <stdlib.h> char *gcvt(double val, int precision, char *buf); char *gcvtf(float val, int precision, char *buf);
gcvt writes a fully formatted number as a null-terminated
string in the buffer
gdvtf produces corresponding
character representations of
gcvt uses the same rules as the
%.precisiong'---only negative values are signed (with
-'), and either exponential or ordinary decimal-fraction format
is chosen depending on the number of significant digits (specified by
The result is a pointer to the formatted representation of val (the same as the argument buf).
Neither function is ANSI C.
Supporting OS subroutines required:
Go to the first, previous, next, last section, table of contents.