title: Parsing numbers with a comma decimal separator in JavaScript
body: <p>I used this function to check if a value is a number:</p>
  
  <pre><code>function isNumber(n) {
      return !isNaN(parseFloat(n)) &amp;&amp; isFinite(n);
  }
  </code></pre>
  
  <p>My program need to work with German values. We use a comma as the decimal separator instead of a dot, so this function doesn't work.</p>
  
  <p>I tried to do this:</p>
  
  <pre><code>n.replace(",",".")
  </code></pre>
  
  <p>But it also doesn't seem to work. The exact function I tried to use is:</p>
  
  <pre><code>function isNumber(n) {
      n=n.replace(",",".");
      return !isNaN(parseFloat(n)) &amp;&amp; isFinite(n);
  }
  </code></pre>
  
  <p>The number looks like this <code>9.000,28</code> instead of the usual <code>9,000.28</code> if my statement wasn't clear enough.</p>