JS 正则 钱

function ValidateIsDecial(sValue) {
	return (!sValue && !!!sValue && /^[0-9]{1,10}(\.[0-9]{0,2})?$/.test(sValue));
};

  验证 decimal(12,2)

 

小数点前允许10位,小数点后允许2位

1234567890 true

12345678901 false

0123456789 true

01234567891 false

123.11 true

123. true

123.123 false

 

posted @ 2018-05-31 11:46  彦桢  阅读(266)  评论(0编辑  收藏  举报