ASPが中国語の数字(大文字金額)の関数に数字を変換します。


2つの異なる関数の実現方法を共有します。
ASPは数字を中国語の数字金額の関数に変えます。

<% 
function Money(thenumber)
'dim Money,i,String1,String2,length,checkp'    
dim one(),onestr()'    
 
String1 = "          "
String2 = "                 "
 
checkp=instr(thenumber,".")'         
if checkp<>0 then
 thenumber=replace(thenumber,".","")'     
end if
length=len(thenumber) '      
redim one(length-1)'        
redim onestr(length-1)'        
for i=0 to length-1
 one(i)=mid(thenumber,i+1,1) '          
 one(i)=mid(string1,one(i)+1,1)'           
 if checkp=0 then '                
  onestr(i)=mid(string2,14-length+i,1)
 else '               
  onestr(i)=mid(string2,15-length+i+len(thenumber)-checkp,1)
 end if
 one(i)=one(i)&onestr(i)'        
 next
  Money=replace(join(one)," ","") '          ,     
  Money=replace(Money,"  "," ")
  Money=replace(Money,"  "," ")
  Money=replace(Money,"  "," ")
  Money=replace(Money,"  "," ")
  Money=replace(Money,"  "," ")
  Money=replace(Money,"  "," ")
 
 do while not instr(Money,"  ")=0
 Money=replace(Money,"  "," ")
 loop
 
' response.write Money '    
 end function
Response.write Money(8200001)
%>
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
Response.write chnumstr("84221213")
%>
ここでASPが中国語の数字(大文字金額)の関数として紹介します。ASPの数字から中国語の数字の内容については、以前の文章を検索したり、下記の関連記事を見たりしてください。これからもよろしくお願いします。