コード例 #1
0
        public AmortizationRow GenerateRow(int paymentNumber,
                                           double previousBalance,
                                           double monthlyInterestRate,
                                           double paymentAmount,
                                           DateTime paymentDate)
        {
            double interestPayment  = previousBalance * monthlyInterestRate;
            double principalPayment = paymentAmount - interestPayment;
            double newBalance       = previousBalance - principalPayment;

            return(AmortizationRow.NewBuilder()
                   .WithPaymentNumber(paymentNumber)
                   .WithPaymentDate(paymentDate)
                   .WithPaymentAmount(paymentAmount)
                   .WithInterestPayment(interestPayment)
                   .WithPrincipal(principalPayment)
                   .WithBalance(newBalance)
                   .Build());
        }
コード例 #2
0
 public void AddRow(AmortizationRow row)
 {
     ReportRows.Add(row);
 }