Skip to content

Commit

Permalink
[sql lab] fix numeric sort in data table (apache#3587)
Browse files Browse the repository at this point in the history
Currently numerical values sort as alpha, this addresses the issue.
  • Loading branch information
mistercrunch authored and michellethomas committed May 23, 2018
1 parent 7b02a4c commit fe50f8b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class FilterableTable extends PureComponent {
const newRow = {};
for (const k in row) {
const val = row[k];
if (typeof (val) === 'string') {
if (['string', 'number'].indexOf(typeof (val)) >= 0) {
newRow[k] = val;
} else {
newRow[k] = JSON.stringify(val);
Expand Down Expand Up @@ -150,7 +150,6 @@ export default class FilterableTable extends PureComponent {
}

const rowGetter = ({ index }) => this.getDatum(sortedAndFilteredList, index);

return (
<div
style={{ height }}
Expand Down

0 comments on commit fe50f8b

Please sign in to comment.