Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
I need to subtract one number from the other.
The problem is that the numbers have a dollar sign (because its money), therefore jQuery is treating them as strings instead of numbers.
I have created two variables - toalAssets
and totalLiabilites
. I would like to subtract the latter from the former and place the result into another variable called netWorth
.
Perhaps i need to use parseFloat()
?
But I'm not sure how - This is all a little over my head!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…