将人民币的数字表示转化成大写表示

时间:2022-05-27 18:17:23 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。
将人民币的数字表示转化成大写表示

相关网站: 点击进入与“将人民币的数字表示转化成大写表示”相关的网站

作者:JOEKOE 文章来源:JOEKOE 点击数: 694 更新时间:2004-10-20



<%call Money(22222222222) 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 %>


本文来源:https://www.wddqw.com/doc/e3745896dd88d0d233d46aa4.html