EvotecIT/PSWriteHTML

Question: export to excel deletes all comma

Closed this issue · 1 comments

I have a datatable. The numbers in the html are shown as 1,42. When I export it with the button and open it in excel the commas are deleted and shown as 142.

Thanks for reporting. Version 0.0.128 fixes this issue.

The fix is based on https://datatables.net/forums/discussion/40503/excel-export-and-comma-decimal

{
    "extend": "excelHtml5",
    "title": "Test1",
    "exportOptions": {
        "columns": ":visible",
        "format": {
            body: function (data, row, column, node) {
                data = $('<p>' + data + '</p>').text(); return $.isNumeric(data.replace(',', '.')) ? data.replace(',', '.') : data;
            }
        }
    }
}

Hopefully, it doesn't impact anything else.