设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > ASP

阿拉伯数字转中文数字函数

作者:佚名 出处:网络转载 时间:11-19 点击:

内容载入中...
将"54883661"转为"五千四百八十八万三千六百六十一"的函数

<%
'################################
'函数名:阿拉伯数字转中文数字函数
'作者:网海求生者
'QQ:54883661 date:2002.3.7
'################################
function chnumstr(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
end function
%>

<%
response.write chnumstr(54883661) '呵,偶的QQ号54883661
%>

收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口

站长学院

推荐信息