char *fcvt(double value, int ndigit,
int *decpt, int *sign);
The fcvt() function converts a floating-point value to
a null-terminated string of ndigit digits
(where ndigit specifies the number of digits
desired after the radix point (decimal point)) and returns a pointer to the
string. The total number of digits in the result string is
restricted to an unspecified limit as determined by the precision
of a double.
The high-order digit is non-zero, unless the value is 0. The low-order
digit is rounded. The position of the radix character relative to
the beginning of the string is stored in the integer pointed to
by decpt (negative means to the left of the returned
digits). If value is zero, it is unspecified whether the integer
pointed to by decpt would be 0 or 1. The radix character is not
included in the returned string. If the sign of the result is
negative, the integer pointed to by sign is non-zero,
otherwise it is 0.
If the converted value is out of range or is not representable,
the contents of the returned string are unspecified.
Is a floating-point number to be converted.
Is the number of digits after decimal point.
Is the return pointer to the decimal point position.
Is the return pointer to the sign indicator.
The fcvt() function
always returns a pointer to a null-terminated string of digits.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
- ecvt(), gcvt()
PTC MKS Toolkit 10.3 Documentation Build 39.