Archive of posts with tag '콤마빼기'

javascript comma and uncomma

javascript comma and uncomma

자바스크립트에서 숫자를 표기할때 3자리마다 콤마를 찍어줘야 할 때가 있다 자주 사용하는 기능인데 매번 만들기란 여간 귀찮은게 아니다. 콤마찍기 //콤마찍기function comma(str) { str = String(str); return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');} 콤마 풀기 //콤마풀기function uncomma(str) { str = String(str);...