Problem with numbers... jQuery or JavaScript ?

Problem with numbers... jQuery or JavaScript ?

Hi guys
I've been fighting with a function that uses some plugin to get numbers from some fields in a specific form.

After some time, I found some example code that added "* 1" to the value for treating the value as number. I mean:

        
  1.  var total = jQuery("#myfield").val() + subTotal;
was not working, while this code





   
  1.  var total = (jQuery("#myfield").val() * 1) + (subTotal * 1);
worked perfectly...

Why is this problem? Any reference? Any plugin that can solve this? Maybe a math plugin?