// js数字每三位加逗号(千分位格式)美元格式3位一个逗号 handleUs(val){ // eg:2536995 --->2,536,995 爽得一匹 return val.toLocaleString() }, // toLocaleString() 还可以将数字转为百分比 eg: var a = 1;
console.log(a.toLocaleString('zh',{style:'percent'})) -->"100%" -->爽得一匹
标签:toLocaleString,数字,val,eg,千分,逗号,好用 From: https://www.cnblogs.com/myfirstboke/p/17174882.html