免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1878 | 回复: 4
打印 上一主题 下一主题

急求函数!关于金额转换! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-04-11 17:02 |只看该作者 |倒序浏览
急求大小写金额转换的函数,是小写转换为大写!
哪们大侠有,请赐教!非常感谢!

论坛徽章:
0
2 [报告]
发表于 2003-04-11 22:27 |只看该作者

急求函数!关于金额转换!

请搜索一下去年的精华贴吧!

论坛徽章:
0
3 [报告]
发表于 2003-04-12 10:00 |只看该作者

急求函数!关于金额转换!

我找了,没有啊!
有的是大小写字母转换,没有大小写金额转换!
给个链接,好吗?
flyegg 该用户已被删除
4 [报告]
发表于 2003-04-13 23:08 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
5 [报告]
发表于 2003-04-14 09:04 |只看该作者

急求函数!关于金额转换!

小写金额转换成大写金额
int i,lendec,lenint
string numstr,a,b,c,d,bbak
numstr=string(aje,"#0.00"
lenint=len(mid(numstr,1,pos(numstr,'.') - 1))
if right(numstr,2)='00' then
lendec=0
else
lendec=2
end if
string dxint[13],dxdec[2],sz[13]
string dxstr="万仟佰拾亿仟佰拾万仟佰拾元"
string szstr="零壹贰叁肆伍陆柒捌玖"
for i=1 to 13
dxint=mid(dxstr,26 - i*2+1,2)
if i<11 then
sz=mid(szstr,i*2 - 1,2)
else
sz=" "
end if
next
dxdec[1]="角"
dxdec[2]="分"
dxstr=" "
for i = 1 to lenint
a = mid(mid(numstr,1,lenint),i,1)
b = sz[integer(a)+1]
c = dxint[lenint - i +1]
if dxstr<>" " then
d = mid(dxstr,len(dxstr) - 1 ,2)
else
d = " "
end if
if b="零" and (d="零" or b=bbak or c="元" or c="万" or c="亿" then b=""
if a="0" and c<>"元" and c<>"万" and c<>"亿" then c=""
if (c="元" or c="万" or c="亿" and d="零" and a="0" then
dxstr=mid(dxstr,1,len(dxstr) - 2)
d = mid(dxstr,len(dxstr) - 1,2)
if (c="元" and d="万" or c="万"and d="亿" then c=""
end if
dxstr=dxstr + b + c
bbak = b
next
for i=1 to lendec
a = mid (mid(numstr,lenint+2,lendec),i,1)
if a="0" and dxdec="分" then
b=""
else
b=sz[integer(a) + 1]
end if
if a<>"0" then
dxstr=dxstr+b+dxdec
else
dxstr=dxstr+b
end if
next
if lendec=0 then dxstr=dxstr+"整"
return dxstr

稍加修改便可
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP