jQuery中如何实现对数字的加减乘除?

parseFloat()取浮点数函数】

示例:

(function($){
      var  price = $('.price').val();
     var  num = $('.num').val();
     price = parseFloat(price);
     num = parselnt(num);
     var total_price = 0;
    total_price = price*num;
    alert(total_price);
    total_price = price+num;
    alert(total_price);
 })(jQuery);