public decimal CalculateMoneyCurrencyAmount(IExchangePair exchangePair) { decimal mainCurrencyRate = _exchangeRates.GetRate(exchangePair.MainCurrency); decimal moneyCurrencyRate = _exchangeRates.GetRate(exchangePair.MoneyCurrency); return((exchangePair.Amount * mainCurrencyRate) / moneyCurrencyRate); }
/// <summary> /// method to value asset in another currency /// </summary> /// <param name="exchangeRates"></param> /// <param name="toCurrency"></param> /// <returns></returns> public decimal Value(IExchangeRates exchangeRates, string toCurrency) { return(Value() * exchangeRates.GetRate(Currency, toCurrency)); }