.TH fcvt() "" "" "General Function (libc)"
.PC "Convert floating-point numbers to strings"
\fBchar *\fR
\fBfcvt(\fId\^\fB, \fIw\^\fB, \fI*dp\^\fB, \fI*signp\fB)\fR
\fBdouble \fId\^\fB; int \fIw\^\fB, *\fIdp\^\fB, *\fIsignp\fB;\fR
.PP
.B fcvt()
converts floating point numbers to ASCII strings.
Its operation resembles that of \fBprintf()\fR's
operator
.BR %f .
.PP
.B fcvt()
converts
.I d
into a NUL-terminated string of decimal digits.
The argument
.I w
sets the precision of the string,
i.e., the number of characters to the right of the decimal point.
.PP
.B fcvt()
rounds the last digit and returns a pointer to the result.
On return,
.B fcvt()
sets
.I dp
to point to an integer that indicates the location of
the decimal point relative to the beginning of the string:
to the right if positive, and to the left if negative.
Finally, it sets
.I signp
to point to an integer
that indicates the sign of
.IR d :
zero if positive, and nonzero if negative.
.B fcvt()
rounds the result to the FORTRAN F-format.
.SH Example
For an example of this function, see the entry for
.BR ecvt() .
.SH "See Also"
.Xr "libc" libc
.SH Notes
.B fcvt()
performs conversions within static
string buffers that it overwrites on each execution.
