mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
feat: Add currencies controls in control panels (#24718)
This commit is contained in:
committed by
GitHub
parent
1a9c559a8f
commit
f7e76d02b7
@@ -22,7 +22,6 @@ import {
|
||||
ensureIsArray,
|
||||
getNumberFormatter,
|
||||
isSavedMetric,
|
||||
NumberFormats,
|
||||
QueryFormMetric,
|
||||
ValueFormatter,
|
||||
} from '@superset-ui/core';
|
||||
@@ -31,7 +30,7 @@ export const getYAxisFormatter = (
|
||||
metrics: QueryFormMetric[],
|
||||
forcePercentFormatter: boolean,
|
||||
customFormatters: Record<string, ValueFormatter>,
|
||||
yAxisFormat: string = NumberFormats.SMART_NUMBER,
|
||||
defaultFormatter: ValueFormatter,
|
||||
) => {
|
||||
if (forcePercentFormatter) {
|
||||
return getNumberFormatter(',.0%');
|
||||
@@ -50,5 +49,5 @@ export const getYAxisFormatter = (
|
||||
) {
|
||||
return customFormatters[metricsArray[0]];
|
||||
}
|
||||
return getNumberFormatter(yAxisFormat);
|
||||
return defaultFormatter ?? getNumberFormatter();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user