title: Trouble with javascript subtraction
body: <p>I'm working on a simple subtraction problem, but unfortunately it keeps returning <code>NaN</code></p>
  
  <p>Here is the function</p>
  
  <pre><code>   function subtraction(a, b) {
          var regexp = /[$][,]/g;
  
          a = a.replace(regexp, "");
          b = b.replace(regexp, "");
  
  
          var _a = parseFloat(a);
          var _b = parseFloat(b);
  
          return _a - _b;
       }
  </code></pre>
  
  <p>And here is how I'm calling it.</p>
  
  <pre><code>txtGoodWill.value = subtraction(txtSellingPrice.value, txtBalanceSheet.value);
  </code></pre>
  
  <p>The numbers that get submitted to the function are ONLY Currency (IE: <code>$2,000</code> or <code>$20</code>, etc)</p>
  
  <p>Now I know that I cannot subtract numbers with a <code>$</code> or a <code>,</code>, but I can't for the life of me figure out why they are getting evaluated in the equasion.</p>