> Okay, im a little stumped. I have been asked to use a formula which
> calculates Monthly Repayments on a mortgage loan. The formula I have been
> given is
>
> M = P * ( J / (1 - (1 + J) ** -N))
>
> My problem is, the last part. It explains it in english as "then take that
> to the -N (minus N) power"
>
> My problem is, I have no idea how to put this into a PHP script so that it
> can calculate it out. I have a feeling im falling short at the "to the
> power of" part. I tried to do a 3 to the power of 3 calculation and I cant
> get it to spit out 27 like I know it should.
>

Chris,

I think this is what you're looking for:

<?PHP
echo "<html><body>";

// principle
$P = 180000;

// annual rate divided by 12 months
$J = 0.0775/12;

// 30 years times 12 months
$N = 360;

// monthly payment
$M = $P*($J/(1-pow((1+$J),-$N)));

echo $M;

echo "</body></html>";
?>

Hope this helps,

Joe



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to