asp金额大小写转换
来源:互联网 发布:web上传文件数据 编辑:程序博客网 时间:2024/05/16 19:27
<!--#include file=common.asp-->
<%
dim tmpnum
'从第一张页面传过来的小写金额
tmpnum=request("page1num")
'调用并显示大写金额
response.write rmb(cdbl(tmpnum))
response.end
%>
common.asp
<%
Function rmb(num)
num = FormatNumber(num, 2)
Dim numList
Dim rmbList
Dim numLen
Dim numChar
Dim numstr
Dim n
Dim n1, n2
Dim hz
numList = "零壹贰叁肆伍陆柒捌玖"
rmbList = "分角元拾佰仟万拾佰仟亿拾佰仟万"
If num > 9999999999999.99 Then
rmb = "超出范围的人民币值"
Exit Function
End If
numstr = CStr(num * 100)
numLen = Len(numstr)
n = 1
Do While n <= numLen
numChar = CInt(Mid(numstr, n, 1))
n1 = Mid(numList, numChar + 1, 1)
n2 = Mid(rmbList, numLen - n + 1, 1)
If Not n1 = "零" Then
hz = hz + CStr(n1) + CStr(n2)
Else
If n2 = "亿" Or n2 = "万" Or n2 = "元" Or n1 = "零" Then
Do While Right(hz, 1) = "零"
hz = Left(hz, Len(hz) - 1)
Loop
End If
If (n2 = "亿" Or (n2 = "万" And Right(hz, 1) <> "亿") Or n2 = "元") Then
hz = hz + CStr(n2)
Else
If Left(Right(hz, 2), 1) = "零" Or Right(hz, 1) <> "亿" Then
hz = hz + n1
End If
End If
End If
n = n + 1
Loop
Do While Right(hz, 1) = "零"
hz = Left(hz, Len(hz) - 1)
Loop
If Right(hz, 1) = "元" Then
hz = hz + "整"
End If
rmb = hz
End Function
%>
- asp金额大小写转换
- 人民币金额大小写转换
- 大小写金额转换
- PB金额大小写转换
- 金额大小写转换
- 金额大小写转换算法
- 金额大小写转换函数
- 大小写金额转换
- 金额大小写转换!
- delphi金额大小写转换
- 金额大小写转换
- 金额大小写转换
- 金额大小写转换正则
- 金额大小写转换
- c# 金额大小写转换
- 数字金额大小写转换
- js金额大小写转换
- JS金额大小写转换
- 丫要挺住
- asp把文章内容中涉及到的图片自动保存到本地服务器
- 失望的Silverlight!【原创】
- ASP字数计算函数
- 用Bake创建新应用程序
- asp金额大小写转换
- 编译asp应用程序成为exe文件
- c#中的interface abstract与virtual
- perl学习笔记四----流程控制
- 用ASP开发WEB日期选择器
- sco unix 7 下安装oracle 8i 的心得
- 计算两个时间之差的函数
- pywin32使用win32com出现SyntaxError
- Is it possible to make asp.net themes available to all sites on the sever?