您好,欢迎来到点滴吧! 手机版
点滴吧www.diandiba.com
记录点点滴滴,尽在点滴吧
  • 文章
  • 文章
  • 特效
  • 素材
  • 景点
您现在的位置:首页 > ASP教程 > 文章正文
将数字转换为中文数字的函数
更新时间:2015/1/5 17:18:02   点击:6272次
<%
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)
%>


上一篇:asp常用类型转换   下一篇:ASP购物车代码
相关文章
导航分类
热门文章
关于我们| 联系我们| 免责声明| 网站地图|
CopyRight 2012-2015 www.diandiba.com - 点滴吧 All Rights Reserved
滇ICP备09005765号-2