hi,
I've been trying to make a function that calculates somebody's monthly mortgage payments, and this is what I have- except it always returns a value of 0
<?
// ((list price - down payment)*(rate/100))+(list price - down payment) = total amount owed after interest
/// (total amount owed) / (years * 12) = per month payment.
/// (rate would need to be as a percent)
function calculator($n1, $n2, $n3, $n4) {
$monthly= ((($n1 - $n2)*($n3/100))+($n1 - $n2));
return $tai / ($n4 * 12);
}
print calculator(150000, 20000, 7, 25);
?>