You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/12/03 21:35:43 UTC
[GitHub] michellethomas commented on a change in pull request #6470: Use
@superset-ui/number-format and @superset-ui/time-format for formatting.
michellethomas commented on a change in pull request #6470: Use @superset-ui/number-format and @superset-ui/time-format for formatting.
URL: https://github.com/apache/incubator-superset/pull/6470#discussion_r238446332
##########
File path: superset/assets/src/setup/setupFormatters.js
##########
@@ -0,0 +1,35 @@
+import { getNumberFormatter, getNumberFormatterRegistry, createSiAtMostNDigitFormatter, NumberFormats } from '@superset-ui/number-format';
+import { getTimeFormatterRegistry, smartDateFormatter, smartDateVerboseFormatter } from '@superset-ui/time-format';
+
+export default function setupFormatters() {
+ const defaultNumberFormatter = createSiAtMostNDigitFormatter({ n: 3 });
+
+ getNumberFormatterRegistry()
+ .registerValue(defaultNumberFormatter.id, defaultNumberFormatter)
+ .setDefaultKey(defaultNumberFormatter.id)
+ // Add shims for format strings that are deprecated or common typos.
Review comment:
👍 I'm not sure that we need to add patterns that don't seem like they were valid formats. Up to you though. Thanks for adding this!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org