Created
August 2, 2022 06:30
-
-
Save 1FahadShakeel/b1b7d605afc06e9f506604e9594e4712 to your computer and use it in GitHub Desktop.
The Excel PMT Function in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pmt(rate, nper, pv) { | |
if (rate == 0) return -(pv) / nper; | |
var pvif = Math.pow(1 + rate, nper); | |
var PMT = rate / (pvif - 1) * -(pv * pvif); | |
return PMT; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment