Difference between revisions of "StrToFloatDef"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function StrToFloatDef(s: AnsiString; def: Extended): Extended; </source> ==Availability== SCAR Divi 3.00 > Current ==Descript...") |
(→Example) |
||
(One intermediate revision by the same user not shown) | |||
Line 13: | Line 13: | ||
<source lang="scar"> | <source lang="scar"> | ||
begin | begin | ||
− | WriteLn(StrToFloatDef('1 | + | WriteLn(StrToFloatDef('1.5', 3)); |
WriteLn(StrToFloatDef('s', 1.5)); | WriteLn(StrToFloatDef('s', 1.5)); | ||
end. | end. | ||
Line 23: | Line 23: | ||
==See Also== | ==See Also== | ||
− | *[[ | + | *[[StrToFloat]] |
*[[FloatToStr]] | *[[FloatToStr]] | ||
Latest revision as of 18:07, 5 July 2011
Definition
function StrToFloatDef(s: AnsiString; def: Extended): Extended;
Availability
SCAR Divi 3.00 > Current
Description
Converts a given string s to an extended floating point value. If s is not a valid floating point value, value given by def is returned.
Example
begin WriteLn(StrToFloatDef('1.5', 3)); WriteLn(StrToFloatDef('s', 1.5)); end.
Output:
1,5 1,5