/**
* Number length limit[0~xxx] (The input type needs to be 'text')
* @param positiveInteger
* @param decimals
* @author Eryou
*/
jQuery.fn.deng_NumMaxLength=function(positiveInteger, decimals){//Integers do not begin with zerolet value =$(this).val();if(value.length >1&&(value.charAt(0)==='0'&& value.charAt(1)!=='.')){$(this).val(value.substr(value.lastIndexOf('0'), value.length -1));}//Check and replace when inputlet re =newRegExp('^((\\d{1,'+ positiveInteger +'})(\\.\\d{0,'+ decimals +'})?).*')if(decimals ===0){$(this).val($(this).val().replace(/[^\d]/g,'').replace(re,'$2'));}else{$(this).val($(this).val().replace(/[^\d.]/g,'').replace(re,'$1'));}}
jQuery——输入框数字校验(全局方法)/** * Number length limit[0~xxx] (The input type needs to be 'text') * @param positiveInteger * @param decimals * @author Eryou */jQuery.fn.deng_NumMaxLength = function (positiveInteger, decimals) { //Integers do not begin w