maths in Javascript.

Posted by Jared on Stack Overflow See other posts from Stack Overflow or by Jared
Published on 2010-03-31T20:44:33Z Indexed on 2010/03/31 20:53 UTC
Read the original article Hit count: 451

Filed under:
|

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 dollar signs (because its money). So it seems that 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 - his is all a little over my head!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery