title: Cannot read property replace of undefined
body: <p>There is code sample: </p>
  
  <pre><code>amountVal = SetAmount(amountVal).replace(/,/g, "");
  var lenght = parseInt((amountVal.length - 4) / 3);
  var rest = amountVal.substring(amountVal.length - 3);
  var main = amountVal.substring(0, amountVal.length - 3);
  </code></pre>
  
  <p>In first line when i try to run script it throw exception:</p>
  
  <blockquote>
    <p>Cannot read property replace of undefined. </p>
  </blockquote>
  
  <p>It works fine for integers, but throw this err when try to use decimal. Any suggestion please?</p>