title: JavaScript; How to set dot after three digits?
body: <p>I have the following JavaScript code:</p>
  
  <pre><code>var calculation = $('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc'))-($('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc')))/100*$('select[name=somevalue3] option:selected').data('calc');
  
  $('#calculation').text((calculation).toFixed(2).replace(".",","))
  </code></pre>
  
  <p>That will calculate a number, change <code>.</code> to <code>,</code> and round it to two digits after comma.</p>
  
  <p>What I need to do is to add a dot after tree digits before come.</p>
  
  <p>Means:</p>
  
  <p><code>1.234,56</code> instead of <code>1234,56</code></p>
  
  <p><code>1.234.567,89</code> instead of <code>1234567,89</code></p>
  
  <p>Does anybody know a way to do that?</p>