JavaScript类型装换
function checkcount(obj){
obj.value = to2bits(obj.value);//把当前金额转换成两位小数金额
var newvalue = obj.value;
var newid = obj.id;
var strF = newid.split('_')[0];
var strS = newid.split('_')[1];
var strCom = strF+"_"+strS+"_";
var strtxtShpAmt = strCom +"lbShpAmt";//出货金额
var strtxtAcrAmt = strCom + "lbAcrAmt";//已收款金额
var strtxAmt = strCom + "txtAmt";//本次收款金额
var txtShpAmt = document.getElementById(strtxtShpAmt);
var txtAcrAmt = document.getElementById(strtxtAcrAmt);
var txAmt = document.getElementById(strtxAmt);
var CheckMoney = parseFloat(txtShpAmt.innerHTML)-parseFloat(txtAcrAmt.innerHTML)-newvalue;
var playMoney=parseFloat(txtShpAmt.innerHTML)-parseFloat(txtAcrAmt.innerHTML);
if(CheckMoney < 0)
{
alert("当前金额超出应收款金额:"+playMoney);
obj.value = "0.00";
}
}
当金额为12,006.00 时也就是有个逗号时parseFloat(txtShpAmt.innerHTML)就会为12,该如何改啊
求救啊