Example #1
0
        public static List <PaymentsScheduleRecord> GetPaymentsSchedule(decimal amount, decimal percent, int term)
        {
            var balance      = amount;
            var interestRate = percent / 1200;

            var payment = CalculatePayment(amount, percent, term);

            var schedule = new List <PaymentsScheduleRecord>();

            for (var period = 0; period < term; period++)
            {
                var interest = Math.Round(balance * interestRate, 2);
                var loan     = payment - interest;
                balance -= loan;

                var record = new PaymentsScheduleRecord
                {
                    Interest = interest,
                    Loan     = loan,
                    Balance  = balance
                };

                schedule.Add(record);
            }
            return(schedule);
        }
Example #2
0
        public static List<PaymentsScheduleRecord> GetPaymentsSchedule(decimal amount, decimal percent, int term)
        {
            var balance = amount;
            var interestRate = percent / 1200;

            var payment = CalculatePayment(amount, percent, term);

            var schedule = new List<PaymentsScheduleRecord>();
            for (var period = 0; period < term; period++)
            {
                var interest = Math.Round(balance * interestRate, 2);
                var loan = payment - interest;
                balance -= loan;

                var record = new PaymentsScheduleRecord
                {
                    Interest = interest,
                    Loan = loan,
                    Balance = balance
                };

                schedule.Add(record);
            }
            return schedule;
        }