본문 바로가기 메뉴 바로가기

대표이미지

[javascript] 3자리수 콤마 처리

2021. 12. 9.
function numberWithCommas(x){
	return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
댓글 갯수
TOP