public async Task <decimal> CalculateInterest(IInterestRateQueryApi interestRateQueryApi) { var interestRate = await interestRateQueryApi.GetInterestRateAsync(); var simpleInterest = Decimal.Multiply(Amount, (decimal)Math.Pow((double)(1 + interestRate), Months)); return(simpleInterest.TruncateInTwoPlaces()); }
public CalculateInterestHandler(ILogging logging, IInterestRateQueryApi interestRateQueryApi) { _logging = logging; _interestRateQueryApi = interestRateQueryApi; }