Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

276
Visualizações
Is there an option to specify the format of a value with DataTables CSV export button?

I am using DataTables to generate a csv report but I am having an issue with formatting some values when opened with excel. The one column contains long numbers such as 014848124888245 that when generated in the csv export are formatted like so: 1.4848124888245E+13. I would like to format these values as a string so that if the csv file is opened with excel the value is displayed in the original format.

I know that this can be solved by just opening the csv file with a text editor, but for this specific use case I need to use the csv export button and open the file using excel.

This is how I instantiate my datatable and the csv export:

var table = $('#unpaidinvoicetable').DataTable( {
   dom: 'Bfrtip',
   buttons: [
   {
      extend: 'csvHtml5',
      exportOptions: {
         columns: ':visible',
         charSet: "utf-8",
      }
   }
   ]
} );

I tried messing around with the exportOptions a bit using datatables' csvHtml5 documentation, but I cannot figure out a way to achieve the formatting I want (not have excel format the value to E notation)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda