note 68071 added to ref.math
| From: | jaakko dot mantila at sagas dot fi | Date: | Wed, 12 Jul 2006 10:10:12 +0000 |
| Subject: | note 68071 added to ref.math | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114690@lists.php.net to get a copy of this message | ||
Here is another payment function with working future value($fv) option:
function payment($r,$np,$pv,$fv,$prec) {
/* Calculates the monthly payment
** $apr = the annual percentage rate of the loan.
** $n = number of monthly payments (360 for a 30year loan)
** $pv = present value or principal of the loan
** $fv = future value of the loan (after payments)
** $prec = the precision you wish rounded to
*/
/****************************************\
** No Warranty is expressed or implied. **
*****************************************/
if(!$fv) $fv = 0;
$mypmt=$r * (-$fv+pow((1+$r),$np)*$pv)/(-1+pow((1+$r),$np));
return round($mypmt, $prec);
}
----
Server IP: 217.160.246.76
Probable Submitter: 212.213.215.242
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.math.php
Edit -- http://master.php.net/note/edit/68071
Del: integrated -- http://master.php.net/note/delete/68071/integrated
Del: useless -- http://master.php.net/note/delete/68071/useless
Del: bad code -- http://master.php.net/note/delete/68071/bad+code
Del: spam -- http://master.php.net/note/delete/68071/spam
Del: non-english -- http://master.php.net/note/delete/68071/non-english
Del: in docs -- http://master.php.net/note/delete/68071/in+docs
Del: other reasons-- http://master.php.net/note/delete/68071
Reject -- http://master.php.net/note/reject/68071
Search -- http://master.php.net/manage/user-notes.php