ICultureInfo.TryParseDouble

Syntax

TryParseDouble(Value: String; Var Result: Double): Boolean;

Parameters

Value. Value converted into real type.

Result. Variable containing result in case of successful conversion.

Description

The TryParseDouble method checks if the specified value can be converted into real type according to regional standard settings.

Comments

If conversion is possible, the Result variable will contain the conversion result and the method returns True, otherwise False.

Example

Sub UserProc;
Var
    CI: ICultureInfo;
    D: Double;
    B: Boolean;
Begin
    CI := CultureInfo.Current;
    B := CI.TryParseDouble("12345,78", D);
End Sub UserProc;

After executing the example the "D" variable will contain the value '123456.78', converted into real type, and the "B" variable will contain the attribute of a successful conversion.

See also:

ICultureInfo