Converts a double value to a formatted string.
#include <stdlib.h> char *ftoa(double value, char *string, unsigned int iplaces, unsigned int fplaces);
value
string
iplaces
fplaces
The converted string has this format:
[-]iii.fffE[-]eee
The value of the number is truncated, not rounded. The algorithm that ftoa uses is accurate to eighteen significant digits. If iplaces plus fplaces exceeds eighteen, they are adjusted so that only eighteen significant digits are used.
For portability, use the sprintf %e conversion specifier. Use the optional field width and precision to control the number of fractional digits. The sprintf %e conversion specifier produces a string in the format [-]d.dddE+ee, with one integer digit left of the decimal point.
A pointer to the converted string.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/stdlib.h | stdlib.h | clib.lib |