(1)数值相加时结尾自动多出“0”

解决方法:
var totalpricestr=string(totalprice);
/ if(totalpricestr)
var find = "\\.";//对句点要转义
var reg = new regexp(find, "g");
var c = totalpricestr.match(reg);
if(c){
if(com.whuang.hsj.endwith(totalpricestr,'00004')){
alert("111");
totalpricestr=totalpricestr.replace(/[0]+0004$/,"");
}
}
newtd03.innerhtml ="总计:"+totalpricestr+"元";
说明:totalprice是number类型,值为:44.230000000000004
(2)判断字符串是否包含句点
var find = "\\.";//对句点要转义
alert("has .")
}else{
alert("no . !!!") ;
(3)如何清空数组
var shoppingcart=new array();//保存购物车内容
shoppingcart.splice(0,shoppingcart.length);
var shoppingcartdiv=$('#shoppingcartdiv');
hoppingcartdiv.empty();