title: how Does /(\d)(?=(\d{3})+(?!\d))/g work?
body: <pre><code>function addTotal(checkValue, openAmount) {
          if(checkValue)
              totalOpenAmount += openAmount;
          else
              totalOpenAmount -= openAmount;
  
          if(blnUpdateCheckAll) updateAllChecked();
  
          document.getElementById('divTotalPayAmount').innerHTML = totalOpenAmount.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
      }
  </code></pre>
  
  <p>how does this <strong>(/(\d)(?=(\d{3})+(?!\d))/g)</strong> work on this function ? it's telling that a number is at least 4 digits?</p>