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))); Link to comment https://forums.phpfreaks.com/topic/214048-financial-math/ 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 Link to comment https://forums.phpfreaks.com/topic/214048-financial-math/#findComment-1113891 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))); Link to comment https://forums.phpfreaks.com/topic/214048-financial-math/#findComment-1113896 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.