fix(plugins): missing currency on small number format in table chart (#27041)

This commit is contained in:
JUST.in DO IT
2024-02-08 15:24:24 -08:00
committed by GitHub
parent cf84f36a6c
commit 6f402991e5
2 changed files with 48 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
* under the License.
*/
import {
CurrencyFormatter,
DataRecordValue,
GenericDataType,
getNumberFormatter,
@@ -64,6 +65,11 @@ export function formatColumnValue(
const smallNumberFormatter =
config.d3SmallNumberFormat === undefined
? formatter
: config.currencyFormat
? new CurrencyFormatter({
d3Format: config.d3SmallNumberFormat,
currency: config.currencyFormat,
})
: getNumberFormatter(config.d3SmallNumberFormat);
return formatValue(
isNumber && typeof value === 'number' && Math.abs(value) < 1