コード例 #1
0
        private static decimal Fv(LoanExt loan, DateTime currentDay, DateTime nextPaymentDay, out decimal poi)
        {
            var daysOfInterest = (nextPaymentDay - currentDay).Days;
            var fv             = Math.Round(Financial.FGivenP(loan.PresentValue, daysOfInterest, loan.DailyInterestRate), 2);

            poi = fv - loan.PresentValue;
            return(fv);
        }
コード例 #2
0
        private bool NextPaymentIsFinal(LoanExt loan, DateTime currentDay, out decimal overage)
        {
            var     nextPaymentDay = NextPaymentDay(currentDay);
            decimal poi;
            var     fv = Fv(loan, currentDay, nextPaymentDay, out poi);

            if ((fv < loan.TotalPayment))
            {
                overage = loan.TotalPayment - fv;
                return(true);
            }
            overage = 0;
            return(false);
        }