Permalink
Browse files

fix: 修改eq方法的==为===

  • Loading branch information...
HuYuee committed Jun 14, 2017
1 parent 0a7ae79 commit b1b390a25c7e23938a020cf6b8a2ba723caf13c8
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/row-util.js
View
@@ -12,7 +12,7 @@ const eq = function(a, b) {
if ((a === null || a === undefined || a === '') && (b === null || b === undefined || b === '')) return true;
//判断输入的值是否相等,a,b是字符串直接比较这两个值即可,没必要判断是否是数据,判断是否是数据使用parseFloat转换有时精度不准(431027199110.078573)
//if (isNumber(a) && isNumber(b) && parseFloat(a) == parseFloat(b)) return true;
if (a + '' == b + '' || a == b) return true;
if (a + '' === b + '' || a === b) return true;
if (isNumber(a) && isNumber(b) && parseFloat(a) - parseFloat(b) < 0.0000005 && parseFloat(a) - parseFloat(b) > -0.0000005) return true;
return false;
}

0 comments on commit b1b390a

Please sign in to comment.