User manual
576
mikoPascal PRO for PIC32
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 justied 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 signicant digits before conversion.
WordToStrWithZeros
Prototype
procedure WordToStrWithZeros(input: word; var output: array[5] of char);
Description Converts input word to a string. The output string is right justied and the remaining positions on the
left (if any) are lled with zeros.
Parameters - input: unsigned integer to be converted
- output: destination string
Returns Nothing.
Requires Nothing.
Example
var t : word;
txt : array[5] of char;
//...
t := 437;
WordToStrWithZeros(t, txt); // txt is ‘00437’
Notes None.