Converts a double precision floating number to a string.
char * _gcvt (double value, int count, char * buffer);
char * gcvt (double value, int count, char * buffer);
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 to store in the string
buffer
The location to store the string result
Remarks
The _gcvt function converts value into a null-terminated string of digits with, possibly, a sign, decimal point and exponent value. The function attempts to output a string without exponent information but falls back on this option when the resulting string is too long to fit within count digits.
Care should be taken with the length of buffer, as the value of count does not represent the number of characters required to form the entire result.