ICultureInfo.ParseCurrency

Syntax

ParseCurrency(Value: String): Currency;

ParseCurrency(Value: string): decimal;

Parameters

Value. Value converted into currency type.

Value. Value converted into decimal type.

Description

The ParseCurrency method converts the specified value to the currency type according to the regional standard settings.

NOTE. In Fore.NET, the ParseCurrency method converts the specified value into decimal type according to regional standard settings.

Comments

If the conversion is not possible, the exception is generated.

Example

To execute the Fore.NET example, add a link to the ForeSystem system assembly.

Sub UserProc;
Var
    CI: ICultureInfo;
    Cur: Currency;
Begin
    CI := CultureInfo.Current;
    Cur := CI.ParseCurrency("1234,56789");
End Sub UserProc;

Imports Prognoz.Platform.Interop.ForeSystem;

Public Shared Sub Main(Params: StartParams);
Var
    CultCls: ICultureInfoClass = New CultureInfoClassClass();
    CI: ICultureInfo;
    Cur: decimal;
Begin
    CI := CultCls.Current;
    Cur := CI.ParseCurrency(
"1234,56789");
End Sub;

After executing the example the Cur variable contains the value 1234.5679 obtained by converting from the specified string value.

See also:

ICultureInfo