Permalink
Browse files

fix: isNumber判断

  • Loading branch information...
whizbz11 committed Dec 30, 2016
1 parent 5d1e144 commit ff8b74fa59f91e89e2125ff5189ed5245bc4435d
Showing with 2 additions and 1 deletion.
  1. +2 −1 js/util.js
View
@@ -53,7 +53,8 @@ var isDate = function(input) {
};
var isNumber = function(obj) {
//return obj === +obj
return(obj - parseFloat(obj) + 1) >= 0;
//加了个typeof 判断,因为'431027199110.078573'会解析成number
return (typeof obj ==='number') && (obj - parseFloat(obj) + 1 >= 0);
};
var isArray = Array.isArray || function(val) {
return Object.prototype.toString.call(val) === '[object Array]';

0 comments on commit ff8b74f

Please sign in to comment.