ICultureInfo.TryParseDecimal

Syntax

TryParseDecimal(Value: String; Var Result: Decimal): Boolean;

Parameters

Value. Value converted into decimal type.

Result. Variable containing result in case of successful conversion.

Description

The TryParseDecimal method checks if the specified value can be converted into decimal 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;
    B: Boolean;
    D: Decimal;
Begin
    CI := CultureInfo.Current;
    B := CI.TryParseDecimal("1234,56789", D);
End Sub UserProc;

After executing the example the D variable will contain the 1234.5679 value, and the B variable will contain the attribute of a successful conversion.

See also:

ICultureInfo