diff --git a/packages/iris-grid/src/format-context-menus/DecimalFormatContextMenu.ts b/packages/iris-grid/src/format-context-menus/DecimalFormatContextMenu.ts index c7b5daf09..78139ad18 100644 --- a/packages/iris-grid/src/format-context-menus/DecimalFormatContextMenu.ts +++ b/packages/iris-grid/src/format-context-menus/DecimalFormatContextMenu.ts @@ -37,6 +37,10 @@ class DecimalFormatContextMenu { format: DecimalColumnFormatter.FORMAT_BASIS_POINTS, group: DecimalFormatContextMenu.presetGroup, }, + { + format: DecimalColumnFormatter.FORMAT_THOUSANDS, + group: DecimalFormatContextMenu.presetGroup, + }, { format: DecimalColumnFormatter.FORMAT_MILLIONS, group: DecimalFormatContextMenu.presetGroup, diff --git a/packages/iris-grid/src/format-context-menus/IntegerFormatContextMenu.ts b/packages/iris-grid/src/format-context-menus/IntegerFormatContextMenu.ts index 4d2552f22..07b4132d3 100644 --- a/packages/iris-grid/src/format-context-menus/IntegerFormatContextMenu.ts +++ b/packages/iris-grid/src/format-context-menus/IntegerFormatContextMenu.ts @@ -27,6 +27,10 @@ class IntegerFormatContextMenu { onCustomFormatChange: (value: IntegerColumnFormat | null) => void ): FormatContextMenuOption[] { const formatItems = [ + { + format: IntegerColumnFormatter.FORMAT_THOUSANDS, + group: IntegerFormatContextMenu.presetGroup, + }, { format: IntegerColumnFormatter.FORMAT_MILLIONS, group: IntegerFormatContextMenu.presetGroup, diff --git a/packages/jsapi-utils/src/formatters/DecimalColumnFormatter.ts b/packages/jsapi-utils/src/formatters/DecimalColumnFormatter.ts index e6cba5d11..1910aa08d 100644 --- a/packages/jsapi-utils/src/formatters/DecimalColumnFormatter.ts +++ b/packages/jsapi-utils/src/formatters/DecimalColumnFormatter.ts @@ -111,6 +111,12 @@ export class DecimalColumnFormatter extends TableColumnFormatter { 10000 ); + static FORMAT_THOUSANDS = DecimalColumnFormatter.makePresetFormat( + 'Thousands', + '##0.000 k', + 0.001 + ); + static FORMAT_MILLIONS = DecimalColumnFormatter.makePresetFormat( 'Millions', '###,##0.000 mm', diff --git a/packages/jsapi-utils/src/formatters/IntegerColumnFormatter.ts b/packages/jsapi-utils/src/formatters/IntegerColumnFormatter.ts index 1a1b04dae..d8c0a43c1 100644 --- a/packages/jsapi-utils/src/formatters/IntegerColumnFormatter.ts +++ b/packages/jsapi-utils/src/formatters/IntegerColumnFormatter.ts @@ -121,6 +121,12 @@ export class IntegerColumnFormatter extends TableColumnFormatter { static DEFAULT_FORMAT_STRING = '###,##0'; + static FORMAT_THOUSANDS = IntegerColumnFormatter.makePresetFormat( + 'Thousands', + '##0.000 k', + 0.001 + ); + static FORMAT_MILLIONS = IntegerColumnFormatter.makePresetFormat( 'Millions', '###,##0.000 mm',