CurrencyConverterConvert Method (Decimal, Boolean, String, Int32) |
Note: This API is now obsolete.
Converts given monetary amount expressed main currency to different currency using site specific conversion.
Namespace: CMS.EcommerceAssembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 13.0.131
Syntax [ObsoleteAttribute("Use 'CMS.Core.Service.Resolve<ICurrencyConverterService>().Convert(System.Decimal, System.Boolean, System.String, System.Int32)' instead.")]
public static decimal Convert(
decimal amountInMain,
bool inGlobalMain,
string toCurrencyCode,
int siteID
)
Parameters
- amountInMain
- Type: SystemDecimal
Amount in. - inGlobalMain
- Type: SystemBoolean
Indicates if amount is expressed in global main currency. Amount is in site main currency when set to false. - toCurrencyCode
- Type: SystemString
Code of the currency to convert amount to (e.g. EUR). - siteID
- Type: SystemInt32
ID of the site on which the conversion is done.
Return Value
Type:
DecimalAmount converted to target currency on specific site.
Exceptions Exception | Condition |
---|
ArgumentException | Thrown when currency with given code does not exist in the system. |
InvalidCurrencyConversionException | Thrown when conversion fails (e.g. exchange rate not found). |
See Also