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:
was not working, while this code
- var total = jQuery("#myfield").val() + subTotal;
worked perfectly...
- var total = (jQuery("#myfield").val() * 1) + (subTotal * 1);
Why is this problem? Any reference? Any plugin that can solve this? Maybe a math plugin?