Does anyone know why the value in Excel Export table has a "0" at the end?

Does anyone know why the value in Excel Export table has a "0" at the end?

RandomTurtleRandomTurtle Posts: 1Questions: 1Answers: 0

This is (simplified) my html, the value I'm having trouble is in the last column (1690045998985574)

<tr >

                                <td >Ají amarillo</td>
                                <td ></td>
                                <td >202021</td>
                                <td class="visible-lg"></td>
                                <td class="hidden-xs">kg</td>
                                <td class="">Productos Terminados</td>
                                <td class="hidden-xs hidden-sm">5&nbsp;días</td>
                                <td class="hidden-xs hidden-sm"></td>
                                <td ></td>
                                <td >No</td>
                                <td >S/.&nbsp;0.00</td>
                                <td >vegetal</td>
                                <td>1690045998985574</td>

    </tr>

When I export to excel I get the value 1690045998985570 the cell.

This is my export button:

{   extend: 'excel', className: 'btn-sm' ,
                              autoFilter: true,
                              text: '<i class="fa fa-file-excel-o"></i>',
                              messageBottom : e.config.tableExport.messageBottom,
                              orientation: e.orientation,
                              pageSize: e.pageSize,
                              title: function(){
                                  if(e.fileName){
                                      title = (document.CompanyName || 'BITES') + ' | ' + e.fileName;
                                  }else{
                                      title = document.title.replace('BITES' , (document.CompanyName || 'BITES'))
                                  }
                                  return title;
                              },
                              exportOptions: {
                                  columns: ':not(.js-not-export, .excel-no-export)'
                              },
                              
                          }

I tried adding a customize function but still not getting the expected value:

customize: function(xlsx){
                                var sheet = xlsx.xl.worksheets['sheet1.xml'];
                                var bitesCodeCol = "N";
                                $('row c[r^="'+bitesCodeCol+'"]', sheet).attr( 's', '0' );
                            }

I get 1.69005E+15

Has anyone had (and solved) this?

Answers

This discussion has been closed.