jq中金额分和元的转换

分转换为元,无小数点
const str = (totalPayFee/100).toFixed(2) + '';
const intSum = str.substring(0,str.indexOf(".")).replace( /\B(?=(?:\d{3})+$)/g, ',' );
元转换为分

 

num=num*100;//元到分

猜你喜欢

转载自blog.csdn.net/dakache11/article/details/83588952