C
C
ChertyakaNUB2020-12-01 23:27:13
JavaScript
ChertyakaNUB, 2020-12-01 23:27:13

How to export DataTables to Excel without rounding numbers?

Hello!

How to export DataTables to Excel without rounding numbers?
With the standard export method using the Excel button in a table built using DataTables, everything is exported normally except for type data: 8762348732.6723543625, all data is rounded. How to disable rounding, is there a way to bypass this rounding?

Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
BasiC2k, 2020-12-02
@BasiC2k

If you export this field as text, it will remain unchanged.

R
rPman, 2020-12-03
@rPman

export it to csv and already it to excel
ps there are export settings there , you can play with the customizeData method if you return data like this param=''+param;

V
Volodymyr, 2020-12-15
@volodyalesha86

The solution to the issue may be to use the format when exporting, for example like this:

{
                       extend: 'excelHtml5',
                       exportOptions: {
                           format: {
                               body: function ( data, row, column, node ) {
                                   //используйте data или node для отображения данных и их преобразования в нужный формат
                                   //Пример: $(node).find('data').prevObject[0].innerHTML
                                   return ...;
                               }
                           }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question