Datatable export to csv is not working properly, exported csv of the data table giving 7.15175E+14 i

Datatable export to csv is not working properly, exported csv of the data table giving 7.15175E+14 i

siddu_Biradarsiddu_Biradar Posts: 3Questions: 1Answers: 0

Datatable export to csv is not working properly, exported csv of the data table giving 7.15175E+14 instead of the 715175180000591

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @siddu_Biradar ,

    That'll be Excel displaying it in scientific notation - if you format the column, it'll show the correct number.

    Cheers,

    Colin

  • siddu_Biradarsiddu_Biradar Posts: 3Questions: 1Answers: 0

    Hi Colin,

    Thanks for your input, But I wanted to know is there any workaround for this where I can directly view the entire number on opening the CSV in Microsoft Excel?

    Best Regards
    Siddhu

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It's just an Excel thing, unfortunately. I don't believe there's an option to change it, other than reformatting the columns as I suggested above.

    Cheers,

    Colin

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Colin is spot on. Buttons will detect that it is a number that is being exported and thus write an Excel file which specifically says that cell is a number. How Excel then displays that, is really up to it.

    If you need to have it as a fully visible "number" you could turn the cell into a string, which you can do with the customize callback of the excelHtml5 button type. See this example for how to use the customize callback.

    Allan

  • siddu_Biradarsiddu_Biradar Posts: 3Questions: 1Answers: 0

    Thank you very much, Colin and Allan.

This discussion has been closed.