I want to implement PMT function (from Excel) in Java. The formula of the PMT function is:
(D7*D9/12)/(1-(1+D9/12)^(-(D11/12)*12))
where:
For example
D7 = $1,00,000,
D9 = 10%,
D11 = 36
Here the output of PMT function i.e. monthly payment will be $3,226.72
Please anyone help me to calculate this function value in Java.
You can use Apache POI:
http://poi.apache.org/apidocs/org/apache/poi/ss/formula/functions/FinanceLib.html
It saves my day :D
Usage example:
FinanceLib.pmt(0.00740260861, 180, -984698, 0, false)
Parameters: rate, months, present value, future value, at the beginning of the period (or at the end)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With