Jump to content

Financial math


dreamwest

Recommended Posts

Im trying to get a monthly repayment for a loan but a $250,000 loan gives repayments of $136,250 per month

 

function _clean_number($input){
return (float) preg_replace('/[^0-9.]/', '', $input);
}

$id = 7.3; //interest rate
$amount = 250000; // amount of loan
$time = 30; //time in years

$month_term  = $time * 12;
$month_rate = $id / 12;
$power = -($month_term);
$denom = pow((1 + $month_rate), $power);
$amount = _clean_number($amount);

echo number_format($amount * ($month_rate / (1 - $denom)));

 

Link to comment
Share on other sites

Found the prob, i still needed to divide the int rate to a monthly amount:

function _clean_number($input){
return (float) preg_replace('/[^0-9.]/', '', $input);
}

$id = 7.3; //interest rate
$amount = 250000; // amount of loan
$time = 30; //time in years

$month_term  = $time * 12;
$month_rate = ($id / 100) / 12;
$power = -($month_term);
$denom = pow((1 + $month_rate), $power);
$amount = _clean_number($amount);

echo number_format($amount * ($month_rate / (1 - $denom)));

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.