function format(str)
if len(str)=6 then format=str
if len(str)<6 then format=string(6-len(str),"0")&str
if len(str)>6 then format=left(str,6)
end function
<%
function formatnum(num)
numlen=len(num)
if numlen>6 then
'这里是长度大于6的情况(你没说应该怎么处理
else
for i=1 to 6-numlen
num="0"&num
next
formatnum=num
end if
end function
ss=123
response.write formatnum(ss)
%>