User manual

663
mikoPascal PRO for dsPIC30/33 and PIC24
MikroElektronika
FloatToStr
Prototype
procedure FloatToStr(fnum : real; var str : array[23] of char) : byte;
Description Converts a oating point number to a string.
The output string is left justied and null terminated after the last digit.
Parameters - fnum: oating point number to be converted
- str: destination string
Returns Nothing.
Requires Nothing.
Example
var ff1, ff2, ff3 : real;
txt : array[10] of char;
...
ff1 := -374.2;
ff2 := 123.456789;
ff3 := 0.000001234;
FloatToStr(ff1, txt); // txt is “-374.20001”
FloatToStr(ff2, txt); // txt is “123.45678”
FloatToStr(ff3, txt); // txt is “0.000000”
Notes Given oating point number will be truncated to 7 most signicant digits before conversion.