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

猜你喜欢

转载自www.cnblogs.com/yanzhen/p/9115870.html