正则表达式,只能输入正数,可以有小数点,小数点后面两位。

this.value=(this.value.match(/d+(.d{0,2})?/)||[''])[0]

原文地址:https://www.cnblogs.com/Strugglehard/p/5085522.html