\n"; echo "argc = $argc
\n"; echo "argv = $argv
\n"; echo "argv[0] = $argv[0]
\n"; echo "argv[1] = $argv[1]
\n"; echo "PHP_SELF = $_SERVER['PHP_SELF']\n"; echo "

\n"; */ $mort_tmp_dir = "/tmp"; Function Power ($a, $b) { $i = 0; $sum = 1.0; while ($i < $b) { $sum = $sum * $a; $i++; } return $sum; }; ?>

Mortgage Calculator

This is a financial calculator that calculate U.S. mortgage payments schedule.

The formula used is as follows:

r = (interest_rate / 1200) + 1
t = ( r ** 12) ** desired_number_of_years_to_pay_down

monthly_payment = ( mortage_balance * t * (r - 1) ) / ( t - 1)

DISCLAIMER

Although I believe the formula to be correct, and the program to be working, I disclaim all responsibilities for the usage of its results. You should always double check the numbers before making purchasing decisions.

Net Images disclaims any and all warranties with regard to these software, including all express warranties and all implied warranties of merchantability and fitness, for any particular purpose. In no event shall Net Images be liable for damages of any kind, including but not limited to special, indirect or consequential damages resulting from loss of use, data or loss of any past, present, or prospective profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of these software.


Mortgage Payments Schedule Calculator
Enter Starting Balance:
Enter interest rate:
Enter term in years (to pay):
Enter ending balance:
[See Calculation]


Results of previous calculations.

*/ ?>

0) { $r = (doubleval($interest) / 1200.0) + 1.0; $t = Power($r, 12); $t = Power(doubleval($t), $years); $tmp1 = ((doubleval($sbalance) - doubleval($ebalance)) * $t); $tmp2 = ($tmp1 * $r) - $tmp1; $monthly = $tmp2 / ($t - 1.0); /* print out results */ /* $fp = fopen("/home/tin/public_html/calc/mortgage_res.inc", "a+"); $buff = sprintf("%16.2f", $sbalance); fputs($fp, "\n" + "Starting Balance$buff"); fputs($fp, "\n

\n"); $buff = sprintf("%10.4f", $interest); fputs($fp, "\n" + "Interest Rate"); fputs($fp, "" + $buff + "\n\n

\n"); $buff = sprintf("%6u", $years); fputs($fp, "\n" + "Term (years)"); fputs($fp, "" + $buff + "\n\n

\n"); $buff = sprintf("%16.2f", $ebalance); fputs($fp, "\n" + "Ending Balance"); fputs($fp, "" + $buff + "\n\n

\n"); $buff = sprintf("%10.2f", $monthly); fputs($fp, "\n" + "Monthly Payment"); fputs($fp, "" + $buff + "\n\n

\n"); fputs($fp, "\n\n

\n"); fclose($fp); */ ?>

Calculated Results


Mortgage Payments Schedule Calculator
Starting Balance
Interest Rate
Term (years)
Ending Balance
Monthly Payment


Tin "Tin Man" Le / tin@le.org

Home...