function StrToFloat(const S: Substring): Double; overload; inline;
Converts S to a Double by ToDouble's rules, correctly rounded.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | S | Substring |
Returns: Double
Remarks:
A refused text raises EConvertError: '<text>' is not a valid floating point value.
Examples
A text with an exponent.
uses Substr, System.SysUtils;
procedure Example;
begin
Assert(StrToFloat(Substring('125e-2')) = 1.25);
end;