瀏覽代碼

Deterministic sort for floats with empty values (#131)

Jan Stastny 7 年之前
父節點
當前提交
061959a868
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/assets/javascripts/blazer/stupidtable.js

+ 1 - 1
app/assets/javascripts/blazer/stupidtable.js

@@ -95,7 +95,7 @@
       return parseInt(a.replace(/,/g, ''), 10) - parseInt(b.replace(/,/g, ''), 10);
     },
     "float": function(a, b) {
-      return parseFloat(a) - parseFloat(b);
+      return (parseFloat(a) || 0) - (parseFloat(b) || 0);
     },
     "string": function(a, b) {
       if (a < b) return -1;