안규 공부방

ACTIVE SERVER PAGE > function 예제 - 천단위 콤마 찍기

등록일 : 2017-07-03 20:20 조회수 : 93,028

천단위 콤마 찍는 User 함수 입니다.
유용하게 사용하세요.
 

	Function alterLengthType(LengthSource)
		Dim mok,namogi,returnValue,intVari
		mok = int(Len(LengthSource)/3)
		namogi = int(Len(LengthSource) mod 3)
		
		if namogi > 0 then
			returnValue = Mid(LengthSource,1,namogi)
				for intVari = 1 to mok
				returnValue = returnValue&","&Mid(LengthSource,namogi+((intVari-1)*3)+1,3)
				next
		else
			returnValue = Mid(LengthSource,1,3)
			
			if mok > 0 then
				for intVari = 1 to mok
				returnValue = returnValue&","&Mid(LengthSource,intVari*3+1,3)
				next
			end if
		end if
		
		alterLengthType = returnValue
	end Function


 
※ 혹시 도움이 되셨다면 댓글에 한마디 남겨주세요!
작성자   비밀번호
자동글 방지     (자동글 방지 기능입니다.)
내용   댓글달기 
이메일 문의 : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.