ご教示くださいませ。
PMT関数は以下のように関数化できたのですが・・・よろしくお願いいたします。
function pmt($apr, $term, $loan) {
$term = $term * 12;
$apr = $apr / 1200;
$amount = $apr * -$loan * pow((1 + $apr), $term) / (1 - pow((1 + $apr), $term));
return number_format($amount, 2);
}
こちらは参考になるでしょうか。
●File Source for Finance.php - Pear
https://pear.php.net/package/Math_Finance/docs/latest/__filesource/fsource_Math_Finance__Math_Finance-1.0.1MathFinance.php.html
・GitHub版
https://github.com/pear/Math_Finance/blob/master/Math/Finance.php
以下、C,JavaScript,Javaなどのソースも見つかりました。
●GC: Finance - org.apache.poi.ss.formula.functions.Finance (.java) - GrepCode Class Source
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.poi/poi/3.10.1/org/apache/poi/ss/formula/functions/Finance.java#Finance.ppmt%28double%2Cint%2Cint%2Cdouble%29
●Few Excel formulas - PMT, PPMT, XIRR - expressed in ...
https://gist.github.com/pies/4166888
●src/java/org/apache/poi/ss/formula/functions/Finance.java
https://apache.googlesource.com/poi/+/4d81d34d5d566cb22f21999e653a5829cc678ed5/src/java/org/apache/poi/ss/formula/functions/Finance.java
●A Guide to the PMT, FV, IPMT and PPMT Functions
http://www.experts-exchange.com/articles/1948/A-Guide-to-the-PMT-FV-IPMT-and-PPMT-Functions.html
コメント(0件)