0No
0.01Yes
15.99Yes
16Yes
16.01No
PHP中文网2017-06-24 09:45:27
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})?))$/
淡淡烟草味2017-06-24 09:45:27
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);
}