Can anyone help me to convert this VB script to equivalent Javascript please.
PMT = ((PV -开发者_运维知识库 FV) * rate/ (1 - (1 + rate) ^ -(nper)))
Probably
var PMT = ((PV - FV) * rate / (1 - Math.pow(1 + rate, -nper)));
JavaScript numbers are always (at heart) floating-point values, so when you're dealing with money things can get somewhat weird.
精彩评论