title: Currency Format without using toLocaleString() or Intl.NumberFormat()
body: <p>I know a similar question has been asked quiete a few times. 
  The difference here is, that I cannot use a solution that uses .toLocalString() or the wonderful Intl.NumberFormat().</p>
  
  <p>Instead I have to build a formatter from scratch and I have started doing so with this part of code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var currCurrency = "EUR";
  
  function Format__Currency(val, currency) {
  
      switch (currency) {
          case 'EUR':
              currencyFormat = '0,00';
              val = val.replace('.', ',');
              val = currencyFormat.replace('0,00', val);
              break;
          case 'CHF':
              currencyFormat = '0.00';
              val = val.replace(',', '.');
              val = currencyFormat.replace('0.00', val);
              break;
          case 'USD':
              currencyFormat = '0.00';
              val = currencyFormat.replace('0.00', val);
              break;
          default:
              throw new Error('Unknown currency format');
              break;
      }
      return val;
  }
  
  
  var price = Format__Currency("1929.90", "EUR")
  $("#result").html(price);</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;div id="result"&gt; - &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The "manual version" is ok for me as I only have to support 4 or 5 currencies and I will find out what their format has to be.</p>
  
  <p>My problem is that currently I can only change the divider for the decimal places. But there are different thousands separators as well. e.g 1,920.90 for USD, 1.920,90 for EUR or 1'920.90 for CHF. </p>
  
  <p>How can THIS be solved?</p>
  
  <p>PS: If down voters can please tell me what's wrong with this question?</p>