웹마짱구's 블로그

setComma

참고/JavaScript : 2006/12/26 17:19


function setComma(str)
{
       str = ""+str+"";
       var retValue = "";
       for(i=0; i<str.length; i++)
       {
               if(i > 0 && (i%3)==0) {
                       retValue = str.charAt(str.length - i -1) + "," + retValue;
                } else {
                       retValue = str.charAt(str.length - i -1) + retValue;
               }
       }
       return retValue;
}
document.write(setComma(100));
top

참고/JavaScript : 2006/12/26 17:19 Trackback. : Comment. : view 942

Trackback Address :: http://jjangu.pe.kr/blog/trackback/117

Write a comment.




: 1 : ... 432 : 433 : 434 : 435 : 436 : 437 : 438 : 439 : 440 : ... 543 :