Darth-ATA opened a new issue, #40930:
URL: https://github.com/apache/superset/issues/40930
### Summary
When a chart's currency control leaves the **Prefix or suffix** field empty,
Superset always places the currency symbol as a **suffix**, regardless of the
currency or the deployment locale.
In `CurrencyFormatter.format()` the fallback is hardcoded:
```ts
// Unknown symbolPosition - default to suffix
return `${normalizedValue} ${symbol}`;
```
This produces locale-incorrect output for the most common currencies. With
no explicit position chosen, `USD`, `GBP`, `EUR`, etc. all render as `56.1M $`,
`56.1M £`, `56.1M €` — whereas the conventional placement for most of these
(and the convention of most locales) is a prefix (`$56.1M`).
### Expected behavior
When the symbol position is left unset, the placement should follow the
convention of the deployment locale instead of a hardcoded suffix.
`Intl.NumberFormat` already encodes these conventions per locale and currency:
- `en-US`: `USD`, `GBP`, `EUR` → prefix (`$1`, `£1`, `€1`)
- `fr-FR` / `de-DE`: `EUR` → suffix (`1 €`)
An **explicit** Prefix/Suffix selection must always be honored and remain
unaffected.
### Proposal
Derive the default symbol position from `Intl.NumberFormat` using the
deployment locale (the same locale already passed to `setupFormatters` for d3
number formatting), falling back to `prefix` for unknown currency codes. This
keeps the platform's own i18n data as the single source of truth and avoids
hardcoded per-currency lists.
This is a behavior change for charts that relied on the previous
always-suffix default for unset positions, so it should be documented in
`UPDATING.md`.
I have a working implementation with unit tests and am happy to open the PR
(linked below). Filing this first to validate the approach with maintainers.
### Scope / security
No authorization or data-access behavior changes — this only affects
client-side number/currency presentation.
--
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]