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
NaN means "Not A Number".
Make sure you check for each input value whether it is numeric. Throw an error message if one is not, or set it to 0, depending on whether it's essential to your calculation or not.
A good collection of the best ways to check a value for whether it's numeric is this SO question: Validate numbers in JavaScript - IsNumeric()