웹마스터 팁

홈페이지 가지신분들은 많이 놀러오세요.
http://www.zentoo.com

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 +"원";
}

쓰는 방법은 setComma(3000);
이렇게 쓰세요.