//只能输入最大长度为8且最多包含两位小数的数字
function checkCancelAmt(obj) {
var reg = $(obj).val().match(/\d+.?\d{0,2}/);
var txt = ‘’;
if (reg != null) {
txt = reg[0];
}
$(obj).val(txt);
var v = $(obj).val();
if (/\d+.+\d{0,2}/.test(v)) {
}
else{
if (v > 0) {
reg = $(obj).val().match(/(^[1-9]+[0-9]*)+/);
txt = '';
if (reg != null) {
txt = reg[0];
}
v = txt;
$(obj).val(v);
}
else if(v == 0){
$(obj).val(0);
}
}
}