开发工具:
文件大小: 29kb
下载次数: 0
上传时间: 2013-04-11
详细说明: 数字转成人民币大写代码 Public Function GetChinaNum(otherNum As Double, Optional isRMB As Boolean, Optional numOption As Boolean, Optional dotNum As Integer) As String On Error Resume Next num = Trim(Str(Int(otherNum))) If isRMB Then numwei = "拾佰仟万拾佰仟亿拾佰仟" numshu = "零壹贰叁肆伍陆柒捌玖拾" Else numwei = "十百千万十百千亿十百千" numshu = "零一二三四五六七八九十" End If If otherNum < 20 And otherNum >= 10 Then num = Right(num, 1) GetChinaNum = Left(numwei, 1) End If For i = 1 To Len(num) bstr = Mid(num, i, 1) If numOption Then GetChinaNum = GetChinaNum + Mid(numshu, Val(bstr) + 1, 1) Else GetChinaNum = GetChinaNum + Mid(numshu, Val(bstr) + 1, 1) If bstr = "0" Then If Mid(numwei, Len(num) - i, 1) = "万" Or Mid(numwei, Len(num) - i, 1) = "亿" Then Do While Right(GetChinaNum, 1) = "零" GetChinaNum = Left(GetChinaNum, Len(GetChinaNum) - 1) Loop GetChinaNum = GetChinaNum + Mid(numwei, Len(num) - i, 1) End If Else GetChinaNum = GetChinaNum + Mid(numwei, Len(num) - i, 1) End If GetChinaNum = Replace(GetChinaNum, "零零", "零") End If Next i If numOption = False Then Do While Right(GetChinaNum, 1) = "零" GetChinaNum = Left(GetChinaNum, Len(GetChinaNum) - 1) Loop End If If isRMB Then numrmb = "元角分" GetChinaNum = GetChinaNum + Mid(numrmb, 1, 1) If Val(num) <> otherNum Then num = Trim(Str(Round(otherNum - Val(num), 2))) For i = 2 To Len(num) bstr = Mid(num, i, 1) GetChinaNum = GetChinaNum + Mid(numshu, Val(bstr) + 1, 1) + Mid(numrmb, i, 1) Next i Else GetChinaNum = GetChinaNum + "整" End If Else If Val(num) <> otherNum Then If dotNum = 0 Then dotNum = 4 num = Trim(CStr(Round(otherNum - Val(num), dotNum))) If GetChinaNum = "" Then GetChinaNum = "零" GetChinaNum = GetChinaNum + "点" For i = 2 To Len(num) bstr = Mid(num, i, 1) GetChinaNum = GetChinaNum + Mid(numshu, Val(bstr) + 1, 1) Next i End If End If End Function ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.