// 3자리마다 콤마찍기 function fncComma(intNum) { if(isNaN(intNum) || intNum.length==0) return ""; var sRetVal = ""; var sTmpVal = ""; var sFractionVal = ""; intNum = intNum.toString(); intNum = intNum.replace(/,/g,""); var lLengh = intNum.search(/\./); if (lLengh<0) lLengh = intNum.length; else sFractionVal = intNum.substr(lLengh); lLengh = lLengh; var lRemainder = lLengh % 3; if (lRemainder == 0 && lLengh > 0) lRemainder = 3; sRetVal = intNum.substr(0,lRemainder); while(lRemainder < lLengh) { sTmpVal = sTmpVal + "," + intNum.substr(lRemainder,3); lRemainder += 3; } sRetVal = sRetVal + sTmpVal + sFractionVal; return sRetVal; }