Skip to content

Commit 9031069

Browse files
authored
Merge pull request #7180 from prx-lmo/hotfix/6388
fix: 6388 RowSorter doesn't sort numberStr in scientific notation correctly
2 parents c4e9e0f + 7767183 commit 9031069

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/js/services/rowSorter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ module.service('rowSorter', ['uiGridConstants', function (uiGridConstants) {
122122

123123

124124
function parseNumStr(numStr) {
125-
return parseFloat(numStr.replace(/[^0-9.-]/g, ''));
125+
if (/^\s*-?Infinity\s*$/.test(numStr)) { // check for positive or negative Infinity and return that
126+
return parseFloat(numStr);
127+
}
128+
return parseFloat(numStr.replace(/[^0-9.eE-]/g, ''));
126129
}
127130

128131

0 commit comments

Comments
 (0)