dreamwest Posted September 21, 2010 Share Posted September 21, 2010 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))); Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 21, 2010 Share Posted September 21, 2010 i have no solution yet, but for that money you may call me employee Quote Link to comment Share on other sites More sharing options...
dreamwest Posted September 21, 2010 Author Share Posted September 21, 2010 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))); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.