Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 227 Bytes

regexp-2.md

File metadata and controls

9 lines (7 loc) · 227 Bytes

对字符串var str = "1000000000" 进行科学计数法,比如结果是1.000.000.000 ☆☆☆☆☆

答案:/(?=(\b)(\d{3})+$)/g

var reg = /(?=(\B)(\d{3})+$)/g;
var str = "1000000000";
str.replace(reg,".");