I am trying to export data from an ag-grid table into excel using the API getDataAsExcel.
I have only one column which is supposed to have string values whereas all other columns are numeric and are displayed in my ag-grid table like "6,999,500".
But when I try exporting it, all my columns have "General" or String format.
For example if my ag-grid looks like this:
TABLE
name | salary | fee
john | 10,000 | 14
dany | 50 | 1,000
where, name -> string
salary -> numeric
fee -> numeric
It's weird that when I export this table into excel, all values are saved as "String" except 14 and 50 in this case. I noticed the numbers which doesn't have a ',' separator (like 14, 50 here) are exported numeric and 10,000 and 1,000 (having NO ',' separator) are exported as string.
I used parseInt() function such as:
if value = 10,000
parseInt(value.replace(/,/g, ''));
I replaced 10,000 with its parsed value, but no luck since it still prints it as String.
How can I change the format of the complete column or atleast parse these values individually?
Any Help will be appreciated!