Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function ToDouble: Double; overload; inline; | Converts the text to a Double, correctly rounded. |
| 2 | class function ToDouble(const S: Substr.Substring): Double; overload; static; inline; | |
| 3 | class function ToDouble(const S: string): Double; overload; static; inline; |
Overload 1: function ToDouble: Double; overload; inline;
Converts the text to a Double, correctly rounded.
Returns: Double - The value; NAN, INF, +INF and -INF are read as special values.
Remarks:
Accepted: leading spaces, a sign, digits with at most one decimal separator (FormatSettings.DecimalSeparator), an exponent (E or e, a sign, at least one digit), trailing spaces; the sign and the exponent are optional. Any other text, or one whose nearest Double is infinite, raises EConvertError: '<text>' is not a valid floating point value for Double type. The class forms take every text kind.
Examples
Texts with exponents.
uses Substr;
procedure Example;
begin
Assert(Substring('1e3').ToDouble = 1000);
Assert(Substring.ToDouble('125e-2') = 1.25);
end;
See Also: Substr.StrToFloat
Overload 2: class function ToDouble(const S: Substr.Substring): Double; overload; static; inline;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | S | Substr.Substring |
Returns: Double
Overload 3: class function ToDouble(const S: string): Double; overload; static; inline;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | S | string |
Returns: Double