From 81ffdaf29cbc8668d187de4bb93afe5fa987e858 Mon Sep 17 00:00:00 2001 From: welefen Date: Mon, 20 Jan 2014 16:41:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=98=AF=E6=95=B0=E5=AD=97=E7=B1=BB=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E7=9A=84=E5=AE=9E=E7=8E=B0=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Common/common.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Common/common.js b/lib/Common/common.js index a8734725..c0eede50 100644 --- a/lib/Common/common.js +++ b/lib/Common/common.js @@ -245,12 +245,9 @@ global.isDir = function(p){ * @param {[type]} obj [description] * @return {Boolean} [description] */ +var numberReg = /^((\d*\.?\d*(?:e[+-]?\d*(?:\d?\.?|\.?\d?)\d*)?)|(0[0-7]+)|(0x[0-9a-f]+))$/i; global.isNumberString = function(obj){ - var parseValue = parseFloat(obj); - if (isNaN(parseValue)) { - return false; - }; - return (parseValue + "").length == (obj + "").length + return numberReg.test(obj); } /** * 判断是否是个promise