Skip to content

Commit

Permalink
Fixed #421
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed May 24, 2018
1 parent abc000e commit cc36e75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export class DataTable extends Component {
else if (value1 == null && value2 == null)
result = 0;
else if (typeof value1 === 'string' && typeof value2 === 'string')
result = value1.localeCompare(value2);
result = value1.localeCompare(value2, undefined, { numeric: true });
else
result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;

Expand All @@ -326,7 +326,7 @@ export class DataTable extends Component {

if (typeof value1 === 'string' || value1 instanceof String) {
if (value1.localeCompare && (value1 !== value2)) {
return (this.state.multiSortMeta[index].order * value1.localeCompare(value2));
return (this.state.multiSortMeta[index].order * value1.localeCompare(value2, undefined, { numeric: true }));
}
}
else {
Expand Down

0 comments on commit cc36e75

Please sign in to comment.