CurrencyConverterServiceTryGetExchangeRate Method (Boolean, String, Int32, Decimal) |
Calculates exchange rate for conversion from main currency to different currency.
Example: if 1 USD = 16 CZK then this method returns 1/16 = 0.0625 for conversion from USD to CZK.
All exceptions are logged into event log.
Namespace: CMS.EcommerceAssembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 13.0.131
Syntax public bool TryGetExchangeRate(
bool fromGlobalMain,
string toCurrencyCode,
int siteID,
ref decimal rate
)
Parameters
- fromGlobalMain
- Type: SystemBoolean
Indicates if conversion is done from global main currency or from site main currency. - toCurrencyCode
- Type: SystemString
Code of currency to convert amount to, e.g. USD, EUR. - siteID
- Type: SystemInt32
ID of the site for which the rate is calculated. - rate
- Type: SystemDecimal
When this method returns, contains exchange rate from main currency to different currency on specific site.
Return Value
Type:
BooleanTrue if exchange rate was obtained successfully; otherwise, false.
Implements
ICurrencyConverterServiceTryGetExchangeRate(Boolean, String, Int32, Decimal)See Also