var num = '21022332.05'
var exp = /^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/
if(exp.test(num)){
alert('right')
}else{
alert('wrong')
}
</script>
可验证 大于等于零,小于等于99999999.99 的数字
测试正确
var s = '12345237987584564656,000.00'var d=s.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")