Skip to content

Commit

Permalink
Fix string value displaying NaN (#6534)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenchma authored and mistercrunch committed Dec 18, 2018
1 parent 9ec3e18 commit 95cdda4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion superset/assets/src/visualizations/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,15 @@ function TableVis(element, props) {
return null;
})
.classed('text-right', d => d.isMetric)
.attr('title', d => (!Number.isNaN(d.val) ? formatValue(d.val) : null))
.attr('title', (d) => {
if (typeof d.val === 'string') {
return d.val;
}
if (!Number.isNaN(d.val)) {
return formatValue(d.val);
}
return null;
})
.attr('data-sort', d => (d.isMetric) ? d.val : null)
// Check if the dashboard currently has a filter for each row
.classed('filtered', d =>
Expand Down

0 comments on commit 95cdda4

Please sign in to comment.