]> git.8kb.co.uk Git - playtime/mortgage_calculator/commitdiff
maintain overpayments in total paid figure master
authorglyn <glyn@8kb.co.uk>
Mon, 9 Jun 2014 16:03:49 +0000 (17:03 +0100)
committerglyn <glyn@8kb.co.uk>
Mon, 9 Jun 2014 16:03:49 +0000 (17:03 +0100)
mcalc.pl

index 6bb75784f8da4487b9406a94e1e7817622642670..57812dd119e290038cf7f336abc7ea46595dbb7f 100755 (executable)
--- a/mcalc.pl
+++ b/mcalc.pl
@@ -95,7 +95,7 @@ do_it: {
 
                for ($month = 1; $month <= 12; $month++) {              
                        $month_value = $month_value+($month_value*$monthly_interest)-($monthly_payment+$monthly_overpayment);
-                       $total_paid = $total_paid + $monthly_payment;
+                       $total_paid = $total_paid + $monthly_payment + $monthly_overpayment;
                        $interest_accrued = $interest_accrued + ($month_value*$monthly_interest);
                        if (($month == 12) || ($month_value <= 0)){
                                print "End of year ", pack("A5",$year);