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());
        }
示例#2
0
 public CalculateInterestHandler(ILogging logging, IInterestRateQueryApi interestRateQueryApi)
 {
     _logging = logging;
     _interestRateQueryApi = interestRateQueryApi;
 }