From 7b33d5457ba2e8bdf56a1469003a64a2217594ca Mon Sep 17 00:00:00 2001 From: Jesse Yang Date: Wed, 22 Apr 2020 10:07:37 -0700 Subject: [PATCH] fix: change number format to original value to "~g" (#9608) Originally it uses " ", which do give the original value, but will not work when the `getNumberFormatter` in `superset-ui/number-format` is called for the second time. Because the format will successfully register as "" [1], but cannot be obtained again via `registry.get()`[2]. [1]: https://github.com/apache-superset/superset-ui/blob/44ad062dd02d080362dac28782c0327cc9fa3445/packages/superset-ui-number-format/src/NumberFormatterRegistry.ts#L30 [2]: https://github.com/apache-superset/superset-ui/blob/dc804b7a707e0cb8c29fc129bfff2c9aa143fd62/packages/superset-ui-core/src/models/RegistryWithDefaultKey.ts#L36 --- superset-frontend/src/explore/controls.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/controls.jsx b/superset-frontend/src/explore/controls.jsx index 055410a7f..6306928f3 100644 --- a/superset-frontend/src/explore/controls.jsx +++ b/superset-frontend/src/explore/controls.jsx @@ -83,7 +83,7 @@ export const PRIMARY_COLOR = { r: 0, g: 122, b: 135, a: 1 }; // input choices & options export const D3_FORMAT_OPTIONS = [ ['SMART_NUMBER', 'Adaptative formating'], - [' ', 'Original value'], + ['~g', 'Original value'], [',d', ',d (12345.432 => 12,345)'], ['.1s', '.1s (12345.432 => 10k)'], ['.3s', '.3s (12345.432 => 12.3k)'],