Click or drag to resize
ICurrencyConverterConvert Method
Converts monetary value from one currency to other currency.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 12.0.0
Syntax
C#
decimal Convert(
	decimal amount,
	string inCurrencyCode,
	string toCurrencyCode
)

Parameters

amount
Type: SystemDecimal
Monetary amount to be converted.
inCurrencyCode
Type: SystemString
Code of currency in which amount is expressed, e.g. USD, EUR.
toCurrencyCode
Type: SystemString
Code of currency to convert amount to, e.g. USD, EUR.

Return Value

Type: Decimal
Amount converted to currency specified by toCurrencyCode parameter.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when currency with given code does not exist in the system.
InvalidCurrencyConversionExceptionThrown when conversion fails (e.g. exchange rate not found).
See Also