设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

一个简单的小写金额转中文的函数

1970-1-1 08:00| 发布者: 海狸先生『文章』| 查看: 1791| 评论: 0

Public Function URmb(ByVal Money As Currency) As String

Dim i As Integer, strMoney As String
  
   strMoney = StrReverse(Format(Money, "#.##") * 100)
  
   If Len(strMoney) > 14 Then MsgBox "超出范围!": Exit Function

   For i = 1 To Len(strMoney)
      URmb = Mid$("零壹贰叁肆伍陆柒捌玖", Mid$(strMoney, i, 1) + 1, 1) & Mid$("分角元拾佰仟万拾佰仟亿拾佰仟", i, 1) & URmb
   Next

End Function

最新评论

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-3 18:37 , Processed in 0.063060 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部