ASP阿拉伯数字转中文数字

################################ 
函数名:阿拉伯数字转中文数字函数 
################################ 
function  chnumstr(num) 
num
= int ( abs (num))
strlen
= len (num) 
for  i = 1   to  strlen 
select   case   mid (num,i, 1
case   1 :chnum = " " : case   2 :chnum = " " : case   3 :chnum = " "
case   4 :chnum = " " : case   5 :chnum = " "  
case   6 :chnum = " " : case   7 :chnum = " " : case   8 :chnum = " "
case   9 :chnum = " " : case   0 :chnum = " "  
end   select  
chnumstr
= chnumstr & chnum 
if  i = strlen - 1   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 2   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 3   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 4   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 5   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 6   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 7   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
if  i = strlen - 8   and   mid (num,i, 1 ) <> 0   then  chnumstr = chnumstr & " "  
next  
if   left (chnumstr, 1 ) = " "   then  chnumstr = right (chnumstr, len (chnumstr) - 1 )
if   right (chnumstr, 1 ) = " "   then  chnumstr = left (chnumstr, len (chnumstr) - 1 )
end function  
 

你可能感兴趣的:(ASP)