Is there any specific way where I can control the update of each data in a column of the csv
file. I want few columns to be in text format and few in number format.
For eg:
I want to update this column with heading "Stock" and the values are :
250.000,10.000,0.000,0.000,2.500,30.000,700.000,10.000,250.000,0.000.
However the exported csv
file is not taking the decimal values. It is displaying as
250,10,0,0,2.5 etc
Usually manually I can go to the csv
file each column, select it, right click , format cell and then change the format to text or number. However I don't want to do it manually. I want it to be automatically done when my csv
is exported.
Code:
$.each(exportArray, function (index, value) {
csvData.push(x[index] + "," + y[index] + "," + d[index] + "," + z[index] + ","+ a[index] + "," + e[index] + "," + b[index] + "," + c[index]);
});
csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(output);
$(this)
.attr({
'download': filename,
'href': csvData,
'target': '_blank'
});