From 5be82ba2bd3cefaaf46ed5fc320f270eee21964c Mon Sep 17 00:00:00 2001 From: suraj mittal Date: Wed, 22 Feb 2023 14:13:18 +0530 Subject: [PATCH 1/3] add indian numbering system --- superset-frontend/src/setup/setupFormatters.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/superset-frontend/src/setup/setupFormatters.ts b/superset-frontend/src/setup/setupFormatters.ts index bc5efc1ed35be..b66571043fdfa 100644 --- a/superset-frontend/src/setup/setupFormatters.ts +++ b/superset-frontend/src/setup/setupFormatters.ts @@ -24,6 +24,7 @@ import { getTimeFormatterRegistry, smartDateFormatter, smartDateVerboseFormatter, + createD3NumberFormatter, } from '@superset-ui/core'; export default function setupFormatters() { @@ -66,6 +67,18 @@ export default function setupFormatters() { .registerValue( 'DURATION_SUB', createDurationFormatter({ formatSubMilliseconds: true }), + ) + .registerValue( + 'CURRENCY_INDIA', + createD3NumberFormatter({ + locale: { + decimal: '.', + thousands: ',', + grouping: [3, 2, 2, 2, 2, 2, 2, 2, 2, 2], + currency: ['₹', ''], + }, + formatString: '$,.2f', + }), ); getTimeFormatterRegistry() From 2aa8ed470f5062cfefef32fe2906ab217d0de626 Mon Sep 17 00:00:00 2001 From: suraj mittal Date: Wed, 22 Feb 2023 14:13:58 +0530 Subject: [PATCH 2/3] random commit --- superset-frontend/src/setup/setupFormatters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/setup/setupFormatters.ts b/superset-frontend/src/setup/setupFormatters.ts index b66571043fdfa..172bfb6915d9a 100644 --- a/superset-frontend/src/setup/setupFormatters.ts +++ b/superset-frontend/src/setup/setupFormatters.ts @@ -75,7 +75,7 @@ export default function setupFormatters() { decimal: '.', thousands: ',', grouping: [3, 2, 2, 2, 2, 2, 2, 2, 2, 2], - currency: ['₹', ''], + currency: ['₹', ''] }, formatString: '$,.2f', }), From ebe5fc4fc248508d42030b9266d4b5235e74809a Mon Sep 17 00:00:00 2001 From: suraj mittal Date: Wed, 22 Feb 2023 14:14:34 +0530 Subject: [PATCH 3/3] Revert "random commit" This reverts commit 2aa8ed470f5062cfefef32fe2906ab217d0de626. --- superset-frontend/src/setup/setupFormatters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/setup/setupFormatters.ts b/superset-frontend/src/setup/setupFormatters.ts index 172bfb6915d9a..b66571043fdfa 100644 --- a/superset-frontend/src/setup/setupFormatters.ts +++ b/superset-frontend/src/setup/setupFormatters.ts @@ -75,7 +75,7 @@ export default function setupFormatters() { decimal: '.', thousands: ',', grouping: [3, 2, 2, 2, 2, 2, 2, 2, 2, 2], - currency: ['₹', ''] + currency: ['₹', ''], }, formatString: '$,.2f', }),