ICultureInfo.TryParseDouble

Syntax

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

Parameters

Value. The value converted to 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 contains the 123456.78 value converted to real type, and the "B" variable contains the attribute of a successful conversion.

See also:

ICultureInfo