From: glyn Date: Mon, 9 Jun 2014 16:03:49 +0000 (+0100) Subject: maintain overpayments in total paid figure X-Git-Url: https://git.8kb.co.uk/?a=commitdiff_plain;ds=sidebyside;p=playtime%2Fmortgage_calculator maintain overpayments in total paid figure --- diff --git a/mcalc.pl b/mcalc.pl index 6bb7578..57812dd 100755 --- 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);