MyChat Scripts Engine: FloatToStr, conver a fractional number to a string
"For developers", "Server scripts", "Functions description", "Converting types", "FloatToStr".
Converting a floating-point value to a string.
Syntax
function FloatToStr(iValue: extended): string;
Parameters and return values
Parameter |
Type |
Value |
iValue |
extended |
real number that you need to convert to a string. |
Function result
Text string that corresponds to the transmitted fractional number.
Example
var
amount1, amount2, amount3: extended;
begin
amount1 := 1234567890.123456789;
amount2 := 1234567890123456.123;
amount3 := 1E100;
mLogScript('Amount1 = ' + floattostr(amount1), '');
mLogScript('Amount2 = ' + floattostr(amount2), '');
mLogScript('Amount3 = ' + floattostr(amount3), '');
end.
Script work result
[08:34:37] (Log "FloatToStr"): Amount1 = 1234567890.123456960000
[08:34:37] (Log "FloatToStr"): Amount2 = 1234567890123456.000000000000
[08:34:37] (Log "FloatToStr"): Amount3 = 1.0E+0100