Skip to content

Commit

Permalink
Update setupFormatters.ts
Browse files Browse the repository at this point in the history
adding indian currency
  • Loading branch information
OlafKocanda authored Jul 8, 2021
1 parent 86a59a2 commit a742ece
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions superset-frontend/src/setup/setupFormatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import {
smartDateVerboseFormatter,
} from '@superset-ui/core';

import {
createD3NumberFormatter
} from '@superset-ui/number-format';

export default function setupFormatters() {
getNumberFormatterRegistry()
// Add shims for format strings that are deprecated or common typos.
Expand Down Expand Up @@ -63,6 +67,16 @@ export default function setupFormatters() {
.registerValue('$,0f', getNumberFormatter('$,.4f'))
.registerValue('$,.f', getNumberFormatter('$,.4f'))
.registerValue('DURATION', createDurationFormatter())
.registerValue('CURRENCY_INDIA',createD3NumberFormatter({
locale: {
decimal: '.',
thousands: ',',
grouping: [3, 2, 2, 2, 2, 2, 2, 2, 2, 2],
currency: ['₹', ''],
},
formatString: '$,.2f',
}),
)
.registerValue(
'DURATION_SUB',
createDurationFormatter({ formatSubMilliseconds: true }),
Expand Down

0 comments on commit a742ece

Please sign in to comment.