/// <summary> /// Converts to another currency. /// </summary> /// <param name="TheNewCurrency">The new currency.</param> public void ConvertToCurrency(eCurrency TheNewCurrency) { // Get the latest currency rates. this.Publish <CCurrencyUpdate>(); // Cache the current conversion rate. double CurrentConversionRate = Currency.ConversionToUSDRate; // Get the instance of the currency. mCurrency = CCurrency.GetCurrency(TheNewCurrency); // Convert the USD to the new currency. Amount *= CurrentConversionRate * Currency.ConversionToUSDRate; }
public CMoney(double TheAmount, eCurrency TheCurrency) { mAmount = TheAmount; mCurrency = CCurrency.GetCurrency(TheCurrency); }