You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by GitBox <gi...@apache.org> on 2018/04/02 04:52:04 UTC

[GitHub] mistercrunch commented on a change in pull request #4545: add two more number formats, add number formats to table

mistercrunch commented on a change in pull request #4545: add two more number formats, add number formats to table
URL: https://github.com/apache/incubator-superset/pull/4545#discussion_r178487022
 
 

 ##########
 File path: superset/assets/visualizations/table.js
 ##########
 @@ -90,10 +90,11 @@ function tableVis(slice, payload) {
         html = `<span class="like-pre">${val}</span>`;
       }
       if (isMetric) {
-        html = slice.d3format(c, val);
+        const numberFormat = slice.datasource.column_formats && slice.datasource.column_formats[c] || fd.number_format || '.3s';
 
 Review comment:
   I should have gotten this on the first pass but I think the right thing to do is to add a new optional arg to `slice.d3format` called `fallbackFormat` or something like that. 
   
   We should also add a comment to that function making it clear what the precedence rule is (column-defined format if available, `fallbackFormat` if it's not, and '0.3s' if no fallback is specified.)

----------------------------------------------------------------
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