TryParseDecimal(Value: String; Var Result: Decimal): Boolean;
Value. The value converted to decimal type.
Result. Variable containing result in case of successful conversion.
The TryParseDecimal method checks if the specified value can be converted into decimal type according to regional standard settings.
If conversion is possible, the Result variable will contain the conversion result and the method returns True, otherwise False.
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 contains the 1234.5679 value, and the "B" variable contains the attribute of a successful conversion.
See also: