Missing starting zeros when exporting CSV file.
Missing starting zeros when exporting CSV file.
![marcobatongbacal](https://secure.gravatar.com/avatar/c2020b600c20d3be1f09d23f3f409475/?default=https%3A%2F%2Fvanillicon.com%2Fc2020b600c20d3be1f09d23f3f409475_200.png&rating=g&size=120)
This is my button to export CSV file,
buttons: [
'print',
'excelHtml5',
{
extend: 'csv',
text: 'CSV',
customize: function(data, config, api){
console.log(data)
}
}
]
and this is my return data
"COL","CORTEZ","JAIME","SAGADRACA","Updated","000008605","00620","2018-07-13 11:47:28","administrator","Update pensioner status"
The starting zeros on data 000008605 is missing when exporting it to CSV. What should i do? Thanks in adavance!
This discussion has been closed.
Answers
Hi @marcobatongbacal ,
I just tried it here, and it's working as expected. If you open the CSV file, it displays the 0s as expected. I suspect the problem is that if you open the file in Excel, it'll strip it out 'helpfully', so you'll need to format the column accordingly - this can't be done in a CSV file, since it only contains the data, there is no formatting information,
Cheers,
Colin