I found i little snipet on internet, about PMT calculate.
function PMT(i, n, p) {
return i * p * Math.pow((1 + i), n) / (1 - Math.pow((1 + i), n));
}
function C
Try it like this:-
function CalculatePMTFromForm(idLoanAmount, idAnnualInterestRate, idMonths, idResult) {
var i = parseFloat($('#' + idAnnualInterestRate).val()) / 1200;
var n = parseFloat($('#' + idMonths).val());
var p = parseFloat($('#' + idLoanAmount).val());
var pmt = PMT(i, n, -p);
$('#' + idResult).val(pmt.toFixed(2));
}
The .val() is likely returning a string type not a number type.