社区
数据库(包含打印,安装,报表)
帖子详情
如何把小写金额转换成大写的金额?
musandy
2004-08-09 12:05:42
例如输入:1234.56元时,可以自动转换为壹仟贰佰叁拾肆元伍角陆分
...全文
247
8
打赏
收藏
如何把小写金额转换成大写的金额?
例如输入:1234.56元时,可以自动转换为壹仟贰佰叁拾肆元伍角陆分
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
rtur
2004-08-09
打赏
举报
回复
to musandy(小倩)
晕~~.
我说的csdn就是本站呀.不是MSDN哟.
我提供的链接里面,就有的啦,就是一个函数,调用它就成.
zhuiguo
2004-08-09
打赏
举报
回复
自己用函数来取一下!
就像三楼那样!
musandy
2004-08-09
打赏
举报
回复
rtur(生活没有 Ctrl-Z) :
你好,我也想安装csdn但,我的VB安装盘里没有,不知在哪里可以下载?
guxizhw
2004-08-09
打赏
举报
回复
给你一个
Public Function ToChineseMoney(ByVal dbMoney As Double) As String
Dim strChineseMoney As String
Dim intMoneyPos As Integer
Dim strMoney As String
Dim j As Integer
Dim k As Integer
Dim varN1 As Variant
Dim varN2 As Variant
Dim varN3 As Variant
varN1 = Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")
varN2 = Array("", "拾", "佰", "仟")
varN3 = Array("元", "万", "亿")
strMoney = Format(CStr(Abs(dbMoney)), "0.00")
intMoneyPos = Len(strMoney)
If CInt(Mid(strMoney, intMoneyPos, 1)) <> 0 Then
strChineseMoney = varN1(CInt(Mid(strMoney, intMoneyPos, 1))) & "分"
End If
intMoneyPos = intMoneyPos - 1
If CInt(Mid(strMoney, intMoneyPos, 1)) <> 0 Then
strChineseMoney = varN1(CInt(Mid(strMoney, intMoneyPos, 1))) & "角" & strChineseMoney
End If
If Round(Abs(dbMoney)) = 0 Then
ToChineseMoney = strChineseMoney
If dbMoney < 0 Then strChineseMoney = "负" & strChineseMoney
Exit Function
End If
intMoneyPos = intMoneyPos - 2 ''移动到个位
j = 0
k = 0
While intMoneyPos > 0
If j Mod 4 = 0 Then
strChineseMoney = varN3(k) & strChineseMoney
k = k + 1
If k > 2 Then
k = 1
End If
j = 0
End If
If Mid(strMoney, intMoneyPos, 1) <> 0 Then
strChineseMoney = varN2(j) & strChineseMoney
End If
strChineseMoney = varN1(CInt(Mid(strMoney, intMoneyPos, 1))) & strChineseMoney
j = j + 1
intMoneyPos = intMoneyPos - 1
Wend
While InStr(1, strChineseMoney, "零零") > 0
strChineseMoney = Replace(strChineseMoney, "零零", "零")
Wend
strChineseMoney = Replace(strChineseMoney, "零亿", "亿零")
While InStr(1, strChineseMoney, "零零") > 0
strChineseMoney = Replace(strChineseMoney, "零零", "零")
Wend
strChineseMoney = Replace(strChineseMoney, "零万", "万零")
While InStr(1, strChineseMoney, "零零") > 0
strChineseMoney = Replace(strChineseMoney, "零零", "零")
Wend
strChineseMoney = Replace(strChineseMoney, "零元", "元")
strChineseMoney = Replace(strChineseMoney, "亿万", "亿")
strChineseMoney = Replace(strChineseMoney, "亿万", "亿")
While InStr(1, strChineseMoney, "零壹拾") > 0
strChineseMoney = Replace(strChineseMoney, "零壹拾", "零拾")
Wend
'If Left(strChineseMoney, 2) = "壹拾" Then
'
' strChineseMoney = Right(strChineseMoney, Len(strChineseMoney) - 1)
'
'End If
If dbMoney < 0 Then
strChineseMoney = "负" & strChineseMoney
End If
ToChineseMoney = strChineseMoney
End Function
rtur
2004-08-09
打赏
举报
回复
http://community.csdn.net/Expert/topic/2810/2810169.xml?temp=.4786798
rtur
2004-08-09
打赏
举报
回复
csdn里搜索一下,多的是。
musandy
2004-08-09
打赏
举报
回复
不好意思,一时看错了,谢谢大家。
guxizhw
2004-08-09
打赏
举报
回复
我郁闷……提供了函数还要找msdn,当偶不存在:(
VB 将
小写
金额
转换成
大写
金额
VB 将
小写
金额
转换成
大写
金额
,直接调用就可以了!!!
小写
金额
转换成
大写
金额
PB编写的把
小写
金额
转换成
大写
金额
的函数.
c语言小程序(人民币
小写
金额
转换成
大写
金额
)
用c语言写的人民币
小写
金额
转换成
大写
金额
C#
小写
金额
转换
大写
金额
C#将
小写
金额
转换成
大写
,很高兴能与大家分享我的资源
小写
金额
转换成
大写
金额
源代码
将输入的
小写
金额
自动
转换成
财务所需的
大写
金额
数据库(包含打印,安装,报表)
1,216
社区成员
55,954
社区内容
发帖
与我相关
我的任务
数据库(包含打印,安装,报表)
VB 数据库(包含打印,安装,报表)
复制链接
扫一扫
分享
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章