javascript 세자리마다 콤마(,) 찍기
script 2010. 2. 18. 15:45
//콤마찍기
function numberFormat(num) {
var pattern = /(-?[0-9]+)([0-9]{3})/;
while(pattern.test(num)) {
num = num.replace(pattern,"$1,$2");
}
return num;
}
//콤마제거
function unNumberFormat(num) {
return (num.replace(/\,/g,""));
}
'script' 카테고리의 다른 글
| UserAgentString.com (0) | 2011.03.10 |
|---|---|
| 익스플로러에서 window.open() 팝업 창의 width가 250 이하로 조정이 안될때 (0) | 2010.09.30 |
| [Link] Google Maps Plugin for jQuery (0) | 2010.09.20 |
| [Link] javascript CDN(Content Delivery Network) Catalog (0) | 2010.07.08 |
| javascript document.referrer (0) | 2010.03.31 |
| javascript 상하 롤링 v1.0 (2) | 2010.01.31 |
| jQuery 1.4 Released (0) | 2010.01.16 |
| jQuery - live() (0) | 2010.01.13 |
| jQuery - data(), removeData() (0) | 2010.01.12 |
| window.onload 여러곳에서 사용하기 (0) | 2009.12.04 |