function num(obj){
/*obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,‘$1$2.$3‘); //只能输入两个小数*/
var len=obj.value.length;
if(!/^([1-9][\d]{0,7}|0)(\.[\d]{0,2})?$/.test(obj.value)){
obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
obj.value = obj.value.replace(/^(\d+)\.(\d\d).*$/,‘$1.$2‘);
}else if(obj.value>3000){
reminder("输入金额不能大于3000元");
$(obj).val(3000);
}
if(len<=0){
$(obj).css("font-size","0.75rem");
$(obj).attr("placeholder","请输入充值金额");
}
}