_fcvt

Converts a double precision floating number to a string.

char * _fcvt (double value, int count, int * decimal, int * sign);

char * fcvt (double value, int count, int * decimal, int * sign);

Required Header
<stdlib.h>

Return Value

Each of these functions returns a pointer to the string representation of a number.

Parameters

value

  The value to be converted into a string

count

  The number of digits after the decimal point

decimal

  The position within the string where the decimal point should go

sign

  The sign of the value being converted

Remarks

The _fcvt function converts the floating point number value into a null-terminated string of digits, using an internal thread-safe buffer. _ecvt also uses the same buffer, so the strings value should be copied before the calling thread issues further calls to either function. Only digits are stored in the string, with padding characters ('0') added if needed or rounding performed if the source number is longer than count digits.

decimal may be 0 or negative, when the decimal point lies to the far left of the returned string. It may be greater than the length of the string if the decimal point lies past the far right.

sign is zero if the number being converted is positive, otherwise its value is non-zero.

Standard Library

See Also    atof, _ecvt, _gcvt, strtod