Excel export: how to set percentage with more than 1 decimal place?
Excel export: how to set percentage with more than 1 decimal place?

Hello,
I need percentage values with more than 1 decimal place (at one case will be 2, another 4) when I export table to excel.
but in default styles I found only:
$('row c[r^="G5"]', sheet).attr('s', '56'); //zero decimal places
$('row c[r^="G4"]', sheet).attr('s', '60'); //one decimal places
how to increase number of decimal places per percentage?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Looks like you will need to create a custom style to add to the built-in styles. This thread may help:
https://datatables.net/forums/discussion/43973/excel-customization-with-4-decimal-places#latest
Kevin
I only need to have 2 decimal places and override existing formatCode to 0.00%.
$(xlsx.xl["styles.xml"]).find('numFmt[numFmtId="167"]').attr('formatCode', '0.00%');
Inspired by the below link for currency $ sign issue.
https://datatables.net/forums/discussion/46914/how-do-i-fix-the-dollar-symbol-appearing-at-the-end-of-amounts-in-exported-excel-spreadsheets