上一篇:判断字符串是否是合法的EMail >>
将阿拉伯数字转成中文字
If Not IsNumeric(StrEng) Or StrEng Like "*.*" Or StrEng Like "*-*" Then
If Trim(StrEng) <> "" Then MsgBox "无效的数字"
CChinese = "": Exit Function
End If
Dim intLen As Integer, intCounter As Integer
Dim strCh As String, strTempCh As String
Dim strSeqCh1 As String, strSeqCh2 As String
Dim strEng2Ch As String
strEng2Ch = "零壹贰叁肆伍陆柒捌玖"
strSeqCh1 = " 拾佰仟 拾佰仟 拾佰仟 拾佰仟"
strSeqCh2 = " 万亿兆"
StrEng = CStr(CDec(StrEng))
intLen = Len(StrEng)
For intCounter = 1 To intLen
strTempCh = Mid(strEng2Ch, Val(Mid(StrEng, intCounter, 1)) + 1, 1)
If strTempCh = "零" And intLen <> 1 Then
If Mid(StrEng, intCounter + 1, 1) = "0" Or (intLen - intCounter + 1) Mod 4 = 1 Then
strTempCh = ""
End If
Else
strTempCh = strTempCh & Trim(Mid(strSeqCh1, intLen - intCounter + 1, 1))
End If
If (intLen - intCounter + 1) Mod 4 = 1 Then
strTempCh = strTempCh & Mid(strSeqCh2, (intLen - intCounter + 1) \ 4 + 1, 1)
If intCounter > 3 Then
If Mid(StrEng, intCounter - 3, 4) = "0000" Then strTempCh = Left(strTempCh, Len(strTempCh) - 1)
End If
End If
strCh = strCh & Trim(strTempCh)
Next
CChinese = strCh
End Function
下一篇:世界第一等-----无须安装WSH而执行VBS >>
相关文章:
- · VB程序界面设计经验点滴
- · WindowsXP的外观风格
- · 浏览文件夹中的图片(用VB实现)
- · 怎样在VB中设计背景动画图案
- · 怎样在VB中画立体图形
- · 在VB中用Paintpicture方法进行图形处理
- · 利用API函数实现图像淡入…
- · VisualBasic动画编程技术
- · 窗体特技效果
- · 利用API函数实现图像淡入…
- · 用VB实现屏幕阴暗操作
- · 用VB实现“百叶窗”的图形…
- · 使用手机连结电脑,发送端消息的实验步骤
- · vb开发通信软件(cloud转…
- · 利用Winsock控件实现局域…
- · 计算两段时间的时间差
- · 大数的阶乘
- · ADO在MICROSOFTDATAACCESS中的角色
- · VB访问数据库的方案比较
- · VisualBasic的数据库编程
- · 一个自动生成用ADO调用S…
- · ADO三大对象的属性、方法…
- · VB调用CDLL时的参数传递问题
- · 通过使用类型库提高VB调用DLL函数的性能
- · 用createdirectory创建文件夹
- · 在VB中使用API关闭窗口
- · VB与WindowsAPI间的呼叫…
- · VB中得到当前目录API定义
- · 创建位图菜单
- · TrueDBREPORT6.0的使用说明
- · 获得某一台网络打印机有几份等待打印的报表
- · VB多媒体程序设计详解
- · VB环境下压缩数据流播放…
- · 关于REALPLAYER显示图像的…
- · 利用VB产生屏幕变暗的效果…
- · 用VB制作屏幕保护程序
- · 经典加密算法在VB中的实现(4)-DES
- · 经典加密算法在VB中的实现(3)-RC4
