/**处理金额的千分位转为数字**/
functio StrToNumber(obj){
	    var reg = /^[0-9]+.?[0-9]*$/;  //验证字符串是否是数字
		if (!(reg.test(obj))) {
		   //为字符串 则判断是否存在','
			if((obj+"").replace(/^\s\s*/, '').replace(/\s\s*$/, '')==""){
		      return 0.00 ;
		   }
		   if(obj== undefined){
		    return 0.00;
		   }
		   if((obj || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')){
		      obj=obj.replace(/,/gi,'');
		      return obj;
		   }
		 }
		return obj;
	}

相关文章:

  • 2021-10-12
  • 2021-08-23
  • 2022-12-23
  • 2021-07-25
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案