Buttons icon indicating copy to clipboard operation
Buttons copied to clipboard

Excel export $ sign alignment

Open nathancassano opened this issue 3 years ago • 1 comments

All the accounting people want the $ dollar sign left aligned for the excel export. Please consider changing the default. Below if the diff we tested to make this change.

js/buttons.html5.js
@@ -583,7 +583,7 @@ var excelStrings = {
                '<?xml version="1.0" encoding="UTF-8"?>'+
                '<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'+
                        '<numFmts count="6">'+
-                               '<numFmt numFmtId="164" formatCode="#,##0.00_-\ [$$-45C]"/>'+
+                               '<numFmt numFmtId="164" formatCode="[$$-409]#,##0.00;-[$$-409]#,##0.00"/>'+
                                '<numFmt numFmtId="165" formatCode="&quot;£&quot;#,##0.00"/>'+
                                '<numFmt numFmtId="166" formatCode="[$€-2]\ #,##0.00"/>'+
                                '<numFmt numFmtId="167" formatCode="0.0%"/>'+

nathancassano avatar Oct 26 '21 18:10 nathancassano

Seems reasonable to me - thanks or the suggestion! Do you want to submit a PR for that, or I can just go ahead and make the change?

AllanJard avatar Oct 27 '21 08:10 AllanJard

Committed in here: https://github.com/DataTables/Buttons/commit/a49a5687c80cf219ab3ab2aa6e569e63a3672be1 . Thanks for this!

AllanJard avatar Oct 18 '23 15:10 AllanJard