javascript - Regular match is greater than 0, no greater than 16, no more than two decimal places
欧阳克
欧阳克 2017-06-24 09:43:27
0
2
990

0No
0.01Yes
15.99Yes
16Yes
16.01No

欧阳克
欧阳克

温故而知新,可以为师矣。 博客:www.ouyangke.com

reply all(2)
洪涛

It’s time to do practice questions

/^((0\.((0[1-9])|([1-9]\d?)))|(([1-9]|1[0-5])(\.[\d]{1,2})?)|(16(\.0{1,2})?))$/
淡淡烟草味

It can be achieved like this

var num=15.61;
var t=num.toString();
if(num>0 && num<16 && t.length>0 && t.length<6){
    alert(num);
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template