From d066323304119ffaa34a2fb33b5a13766d368a93 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 7 Aug 2026 18:23:43 +0100 Subject: [PATCH] Fixed #19415 - standardize currency on table export --- .../views/partials/bootstrap-table.blade.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index c13d6302a9..ef42d04bb4 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -693,6 +693,25 @@ } }; + // Tell tableExport how to interpret numbers in the HTML cells so the + // XLSX export writes correct numeric values on non-US locales. Without + // this the plugin defaults to US format ("," thousands, "." decimal) + // and misparses cells that numberWithCommas() rendered in + // "1.234,56" shape: 3.854,60 becomes 3.8546 (issue #19415). + // Output stays invariant (raw "." decimal, no thousands separator) + // because OpenXML numeric cells must be locale-neutral; Excel handles + // display formatting from the cell style on open. + export_options['numbers'] = { + html: { + decimalMark: "{{ $snipeSettings->digit_separator == '1.234,56' ? ',' : '.' }}", + thousandsSeparator: "{{ $snipeSettings->digit_separator == '1.234,56' ? '.' : ',' }}" + }, + output: { + decimalMark: ".", + thousandsSeparator: "" + } + }; + // This allows us to override the table defaults set below using the data-dash attributes var table = this; var data_with_default = function (key,default_value) {