Seppo Mustonen : Programming Survo in C

Functions in library SURVO.LIB

fconv
Summary

int fconv(number,format,string)
double number;       /* number to be converted */
char *format;        /* format to be used */
char *string;        /* string result */
Description

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.

Return Value

fconv returns 1 if the number is succesfully converted and -1 if the format is too restrictive.

See Also

fnconv

Example

double x=3.14159265;
char format[]="123.123";
char result[32];
fconv(x,format,result);  /* result="  3.142" */


Front page of Survo C libraries