maicnaatz opened a new issue, #45660:
URL: https://github.com/apache/superset/issues/45660
### Bug description
**Background**
In Apache Superset, the chart visualization correctly respects the
configured locale settings and configured D3-formats. In our installation,
German locale is configured:
Python:
BABEL_DEFAULT_LOCALE = "de"
LANGUAGES = {
"de": {"flag": “de”, “name”: “German”},
"en": {"flag": “us”, “name”: “English”},
}
The user interface and charts display numbers correctly using German
formatting:
• Thousands separator: .
• Decimal separator: ,
Example: 3.456,78
**Problem**
When exporting chart data to CSV or Excel, the exported values do not match
the formatting shown in the chart.
Examples:
Chart Display Exported Value
3,5 03. Mai
19,8 19.799.999.237.060.500
**Observed behavior:**
1. CSV and Excel exports ignore the currently selected locale.
2. D3 number formatting affects only the chart rendering and is not
applied to exports.
3. Floating-point values may be exported with excessive precision or as
raw internal representations.
4. Exported files become difficult or impossible to use in localized
versions of Excel.
5. In German Excel, values such as 3.5 may be interpreted incorrectly (as
an date) depending on regional settings.
**Expected Behavior**
CSV and Excel exports should provide data consistent with the selected
Superset locale and chart display settings.
Possible approaches:
**Option A (Preferred)**
• Apply locale-aware formatting during export: 3.456,78 instead of 3456.78
**Option B**
Provide an export option such as:
• Export raw values
• Export formatted values (locale-aware)
**Additional Notes**
Currently there is a discrepancy between:
• Chart display
• CSV export
• Excel export
This can lead to confusion and data quality issues because users expect
exported values to match what they see in the visualization.
Could locale-aware export formatting be supported, or could users be given a
choice between raw and formatted export values?
### Screenshots/recordings
_No response_
### Superset version
6.1.0
### Python version
Not applicable
### Node version
Not applicable
### Browser
Not applicable
### Additional context
_No response_
### Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [ ] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]