Mail Archives: djgpp/1997/06/01/01:54:21
There's the way to convert from float to int:
Function FCVT (propabily Float Converter)
Syntax
#include <stdlib.h>
char *fcvt(double value, int ndig, int *dec, int *sign);
Description
Converts a floating-point number to a string.
fcvt converts value to a null-terminated string digit starting with the
leftmost significant digit with ndig digits to the right of the decimal
point. fcvt then returns a pointer to the string. The position of the
decimal point relative to the beginning of the string is stored indirectly
through dec (a negative value for dec means to the left of the returned
digits). There is no decimal point in the string itself. If the sign of
value is negative the word pointed to by sign is nonzero; otherwise it is 0.
The correct digit has been rounded for the number of digits to the right of
the decimal point specified by ndig.
Return Value
The return value of fcvt points to static data whose content is overwritten
by each call to fcvt and ecvt.
I'll be happy if it helps you. (of course it will.)
This is a part of help from Borland C 4.0
That's the waY!
Guilherme
------------------------------------------------
Guilherme Silveira - Sao Paulo - Brasil
carlos AT usway DOT com - thedarkage AT mail DOT geocities DOT com
http://www.geocities.com/SiliconValley/5441/
18/09/1981 - Until Today...
- Raw text -