Asp教程:如何将小写数字转换为大写数字
function int2chn(n)
dim i,j,k,strlen,retval,x,y,z,str
z=array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖")
y=array("","拾","佰","仟")
x=Array("","万","亿","万万亿")
strlen=len(n)
str1=n
for i= 1 to strlen
j=mid(str1,i,1)
retval=retval&z(j)
if j>0 then retval=retval&y((strlen-i) mod 4)'如果大于零,加入十进位字符
retval=replace(retval,z(0)&z(0),z(0))'出现两个零只留一个
if ((strlen-i) mod 4)=0 and right(retval,1)=z(0) then retval=left(retval,len(retval)-1)'每四位加入进阶
if ((strlen-i) mod 4)=0 then retval=retval&x(int((strlen-i)/4))'把最后的零去掉
next
int2chn=retval
end function
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |