mortage calculator in php wrong amount
<p>i am working on a simple loan calculator, so simple that it's not even working properly.</p>

<pre><code>function calculatePayment($price, $down, $term)
{
    $loan = $price - $down;
    $rate = (4/100) / 12;
    $month = $term * 12;
    $payment = floor(($loan*$rate/1-pow(1+$rate,(-1*$month)))*100)/100;
    return $payment;
}

echo calculatePayment(200000,0,30);
</code></pre>

<p>this output: 666.36</p>

<p>that would be great if the monthly loan payement is this (not that is the 666 number but low number hahah), my problem is this be higher.</p>

<p>why am i getting the this?</p>
