次の行を持つ関数があります。
payementReceived=data.toJSON().total;
paymentTotal=$("#paymentTotal").html();
console.log(typeof(parseInt(paymentTotal)));
console.log(typeof(parseInt(paymentReceived)));
console.log(parseInt(paymentTotal)-parseInt(paymentReceived));
コンソールで次を取得します
number
number
NaN
両方が数値である場合、なぜ適切な減算結果が得られないのかわかりません。