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());
        }
Exemplo n.º 2
0
 public CalculateInterestHandler(ILogging logging, IInterestRateQueryApi interestRateQueryApi)
 {
     _logging = logging;
     _interestRateQueryApi = interestRateQueryApi;
 }