I’m new to javascript. I want to perform an arithmetic calculation between two javascript values as follows.
In here "issues" and "re" contains numeric values. Then I want to deduct "re" from "issues" and assign the outed value to "#bal".
Tried
$('#bal').text(jData.data.issues - jData.data.re);
Output
outs ‘0’
What may be going wrong with me ? Ca anyone help me ?
2
Answers
if ‘issues’ or ‘re’ are not a number, JavaScript can’t do arithmetic calculation
try this code:
otherwise, the value of each is incorrect.
check your type of issues and re,if they are String or else,
they can not go on