Mikroelektronika MIKROE-742 데이터 시트
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
FloatToStr
Dec2Bcd
490
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure FloatToStr(input : real; var output : array[23] of char);
Returns
-
3
if input number is NaN
-
2
if input number is -INF
-
1
if input number is +INF
-
0
if conversion was successful
Description
Converts a floating point number to a string.
Parameters :
-
input
: floating point number to be converted
-
output
: destination string
The output string is left justified and null terminated after the last digit.
Note: Given floating point number will be truncated to 7 most significant digits
before conversion.
before conversion.
Requires
Nothing.
Example
var ff1, ff2, ff3 : real;
txt :
array[23] of char;
...
ff1 := -374.2;
ff1 := -374.2;
ff2 := 123.456789;
ff3 := 0.000001234;
ff3 := 0.000001234;
FloatToStr(ff1, txt); // txt is "-374.2"
FloatToStr(ff2, txt); // txt is "123.4567"
FloatToStr(ff2, txt); // txt is "123.4567"
FloatToStr(ff3, txt); // txt is "1.234e-6"
Prototype
function Dec2Bcd(decnum : byte) : byte;
Returns
Converted BCD value.
Description
Converts input number to its appropriate BCD representation.
Parameters :
-
decnum
: number to be converted
Requires
Nothing.
Example
var a, b : byte;
...
...
a := 22;
b := Dec2Bcd(a); // b equals 34
b := Dec2Bcd(a); // b equals 34