title: Datatables export to Excel and format a numeric column as currency
body: <p>I'm trying to export numeric data to Excel. The numeric formatting is as follows:</p>
  
  <ul>
  <li>Thousands grouping separator: "."</li>
  <li>Decimal point indicator: ","</li>
  <li>Number of decimal points to show: "0"</li>
  <li>Prefix: "$"</li>
  </ul>
  
  <p>And the header and footer texts are formatted as bold.</p>
  
  <p>This is the table:</p>
  
  <pre><code>&lt;table id="idtablainforme_ventaporfamilia" class="table table-striped table-striped table-bordered nowrap dataTable"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  &lt;b&gt;FAMILIA&lt;/b&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;b&gt;VENTA&lt;/b&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tfoot&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;b&gt;TOTAL&lt;/b&gt;&lt;/th&gt;
              &lt;th&gt;&lt;b&gt;$12.925.150&lt;/b&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/tfoot&gt;
      &lt;tbody&gt;
          &lt;tr&gt;&lt;td&gt;CHEQUERA MUJER&lt;/td&gt;&lt;td&gt;$5.231.760&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;CARTERA&lt;/td&gt;&lt;td&gt;$3.487.630&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;BILLETERA MUJER&lt;/td&gt;&lt;td&gt;$2.155.120&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;NECESER&lt;/td&gt;&lt;td&gt;$21.980&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;COSMETIQUERA&lt;/td&gt;&lt;td&gt;$10.990&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;SET DE VIAJE&lt;/td&gt;&lt;td&gt;$10.990&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>This is my try:</p>
  
  <pre><code>&lt;script&gt;
      $('#idtablainforme_ventaporfamilia').DataTable({
          destroy: true,
          "searching": false,
          "paging": false,
          "ordering": false,
          "info": false,
          "autowidth": false,
          columns: [
             { data: "1", render: $.fn.dataTable.render.text() },
             { data: "2", render: $.fn.dataTable.render.number('.', ',', 0, '$') }
          ],
          footerCallback: function (tfoot, data, start, end, display) {
              var $th = $(tfoot).find('th').eq(1);
              $th.text($.fn.dataTable.render.number('.', ',', 0, '$').display($th.text()))
          },
          dom: 'Bfrtip',
          buttons: [
              {
                  extend: 'excel',
                  footer: true,
                  title: 'INFORME DE VENTAS POR FAMILIA',
                  text: '&lt;i class="fa fa-file-excel-o"&gt;&lt;/i&gt;',
                  titleAttr: 'Exporta a EXCEL',
              }
          ]
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>But it doesn't convert the numeric data, and the header and footer texts are not formatted as bold. They are exported in Excel as string, except for the values 21.98 $, 10.99 $ and 10.99 $ (although they should be $21.980, $10.990 and $10.990) as follows:</p>
  
  <pre><code>FAMILIA         VENTA
  CHEQUERA MUJER  $5.494.310
  CARTERA         $5.231.760
  BILLETERA MUJER $2.155.120
  NECESER         21.98  $
  COSMETIQUERA    10.99  $
  SET DE VIAJE    10.99  $
  TOTAL           $12.925.150
  </code></pre>