int fconv(number,format,string)
double number; /* number to be converted */
char *format; /* format to be used */
char *string; /* string result */
The fconv function converts the digits of the given number to a
nullterminated character string and stores the result in string
. The
conversion takes place according to the given format
which is a
null-terminated string of form "1234.123"
or "%8.3f"
. The format ""
means the shortest possible representation of number as string.
fconv returns 1 if the number is succesfully converted and -1 if the format is too restrictive.
double x=3.14159265;
char format[]="123.123";
char result[32];
fconv(x,format,result); /* result=" 3.142" */