金额千分位添加,方法以及金额去除千分位,方法
业务需求:金额在千分位要加上,并且保留两位小数话不多说,直接上代码金额千分位添加function format_number(s) {if (s == null || s == ‘’ || s==0) {return 0}s = s.toString().replace(/^(\d*)$/,’$1.’)s = replace(/(\d*.\d\d)\d*/,’$1’)if (s > 0) {s = (s + ‘00’).replace(/(\d*.\d\d)\d*/,’$1.’)