title: Sum currency with comma and dot
body: <p>My code is working if the separator of decimals is a comma, but the user can choose between dot and comma. </p>
  
  <p>The problem I'm facing is showing the total well formated (with two decimal places; formated by the separator of decimals; and with the separator of thousands as well)</p>
  
  <pre><code>$('#mytable').dataTable(
  {
      'footerCallback': function ( row, data, start, end, display )
      {
          var api = this.api();
  
          // Remove the formatting to get integer data for summation
          var intVal = function ( i ) {
              return typeof i === 'string' ? i.replace(/[\$,]/g, '') * 1 : typeof i === 'number' ? i : 0;
          };
  
          var total  = api.column(3).data()
                                    .reduce( function (a, b) 
                                    {
                                      return intVal(a) + intVal(b);
                                    }, 0);
  
          $('#total').text(parseFloat(total).toFixed(2).replace(/(\d)(?=(\d{3})+\,)/g, '$1,'));
      }
  });
  </code></pre>
  
  <p>You can check the problem directly in <a href="https://jsfiddle.net/hu0d0ft9/" rel="nofollow noreferrer">JSFiddle</a>.</p>
  
  <p><a href="https://i.stack.imgur.com/f9r9J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f9r9J.png" alt="enter image description here"></a></p>