You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.
In English locales it is common to separate thousands by using a comma ie 1000 -> 1,000, also for readability zeros are replaced with a '-' (see jquery datatables)
If you were to feed either of these numbers into the parser a NaN error would result with warning for end user.
Consider either a global or cell specific (when data type is numeric) processor.
A quick and dirty deals with the global (not ideal as there may be legitimate string uses for ','
functionmakeXLSXExport(tableId){lettable=document.querySelector("#"+tableId);lettableT=table.cloneNode(true);;tableT.innerHTML=tableT.innerHTML.replace(/,/g,'');//replaces , globallytableT.innerHTML=tableT.innerHTML.replace(/>-</g,'><');//replaces cells only containing - globallyTableToExcel.convert(tableT);}
The text was updated successfully, but these errors were encountered:
You can format numbers in the excel by using data-num-fmt="#,##0". However, if you add commas in the HTML table cells, it will not be parsed properly. One workaround is to create a column for the display and create another hidden column for exporting to excel.
One thing we can do is, remove the commas from the cell, which is marked as a number. That way, we don't need to create hidden cells for achieving this.
@rohithb - Yes, I was not clear, I think that is the best course of action, if the user sets the cell format as numeric strip all commas before processing.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In English locales it is common to separate thousands by using a comma ie 1000 -> 1,000, also for readability zeros are replaced with a '-' (see jquery datatables)
If you were to feed either of these numbers into the parser a NaN error would result with warning for end user.
Consider either a global or cell specific (when data type is numeric) processor.
A quick and dirty deals with the global (not ideal as there may be legitimate string uses for ','
The text was updated successfully, but these errors were encountered: