Function AddX(val,digit) //参数,第一个:处理的变量;第二个:处理后的位数
if isnull(val) then val="" end if
Dim Ret:Ret=CStr(val)
if(Len(Ret)>digit)then
Ret=right(Ret,digit)
else
Ret=Replace(Space(digit-Len(Ret))," ","0")&Ret //“0”是补位的替代字符
end if
AddZero=Ret
End Function