当前位置: 首页 > news >正文

表白网站生成器俄罗斯电商平台ozon中文

表白网站生成器,俄罗斯电商平台ozon中文,wordpress欢迎页面,浏览器网页版打开网页有时候,我们需要显示中文大写金额,比如打印银行付款申请单等。 新建一个工程,加入一个标准模块在模块中加入如下代码,窗口中调用 AmountInChineseWords 函数即可。最大解析到百万亿,小数最多解析两位到分。 模块代码…

有时候,我们需要显示中文大写金额,比如打印银行付款申请单等。

新建一个工程,加入一个标准模块在模块中加入如下代码,窗口中调用  AmountInChineseWords 函数即可。最大解析到百万亿,小数最多解析两位到分。

模块代码如下: 

'用户昵称: 留下些什么
'个人简介: 一个会做软件的货代
'CSDN网址:https://blog.csdn.net/zezese
'电子邮箱:31319180@qq.comOption Explicit'最大解析到百万亿,小数最多解析两位到分Function AmountInChineseWords(Amount As Double) As StringIf Amount < 0 ThenAmountInChineseWords = "负" & AmountInChineseWords(Abs(Amount))Exit FunctionEnd IfDim strValue As String, strValueInWord As StringstrValue = CStr(Amount)Dim nPoint As IntegernPoint = InStrRev(strValue, ".")If nPoint > 0 Then '有小数点If Amount < 1 ThenstrValueInWord = DecimalInWord(Mid$(strValue, nPoint + 1), True)ElsestrValueInWord = IntegerInWord(Left$(strValue, nPoint - 1)) & DecimalInWord(Mid$(strValue, nPoint + 1), False)End IfElse ' 没有小数点strValueInWord = IIf(Amount = 0, "零", IntegerInWord(strValue) & "整")End IfAmountInChineseWords = strValueInWordEnd FunctionPrivate Function DecimalInWord(strValue As String, bTotalAmountLessThanOne As Boolean) As StringDim strChineseNumericWords()strChineseNumericWords = Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")Dim strRMBUnits()strRMBUnits = Array("角", "分")Dim i As Integer, nValue As IntegerDim strTmp As String, strValueInWord As StringFor i = 1 To Len(strValue)nValue = CInt(Mid$(strValue, i, 1))strTmp = strChineseNumericWords(nValue) & _IIf(nValue > 0, strRMBUnits(i - 1), "")strValueInWord = strValueInWord & strTmpIf i = 2 Then Exit For '最多处理两位小数,到分NextIf bTotalAmountLessThanOne And Left$(strValueInWord, 1) = "零" Then ' 0.01 这种情况需要把前面的零去掉strValueInWord = Mid$(strValueInWord, 2)End IfDecimalInWord = strValueInWordEnd FunctionPrivate Function IntegerInWord(strValue As String) As StringDim strChineseNumericWords(), strChineseNumericUnits()strChineseNumericWords = Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖")strChineseNumericUnits = Array("", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "万", "拾", "佰", "仟")Dim i As Integer, nValue As IntegerDim strTmp As String, strValueInWord As StringFor i = 1 To Len(strValue)nValue = CInt(Mid$(strValue, Len(strValue) - i + 1, 1))If (i = 5 Or i = 9 Or i = 13) And nValue = 0 Then '万, 亿, 万亿位strTmp = strChineseNumericUnits(i - 1)ElsestrTmp = strChineseNumericWords(nValue) & _IIf(nValue > 0, strChineseNumericUnits(i - 1), "")End IfstrValueInWord = strTmp & strValueInWordIf i - 1 = UBound(strChineseNumericUnits) Then Exit For '最多处理到万亿Next'多个零只显示一个零DoIf strValueInWord Like "*零零*" ThenstrValueInWord = Replace$(strValueInWord, "零零", "零")ElseExit DoEnd IfLoop'处理一些特殊情况If strValueInWord Like "*零万*" ThenstrValueInWord = Replace$(strValueInWord, "零万", "万")End IfIf strValueInWord Like "*零亿*" ThenstrValueInWord = Replace$(strValueInWord, "零亿", "亿")End IfIf strValueInWord Like "*亿万*" ThenstrValueInWord = Replace$(strValueInWord, "亿万", "亿")End If'去头去尾If Left$(strValueInWord, 1) = "零" ThenstrValueInWord = Mid$(strValueInWord, 2)End IfIf Right$(strValueInWord, 1) = "零" ThenstrValueInWord = Left$(strValueInWord, Len(strValueInWord) - 1)End IfIntegerInWord = strValueInWord & "元"End Function

http://www.15wanjia.com/news/188706.html

相关文章:

  • 海南电子商务网站wordpress 相对路径
  • 太仓网站制作书生网络营销广告词有哪些
  • 网站备案幕布psd蓝色通用营销型企业网站模板
  • 网站服务器排名中国建筑工业出版社
  • 免费网站为何收录比较慢百度竞价关键词出价技巧
  • 做有网被视频网站吗网页游戏公益服平台
  • 网站图片代码怎么做青岛网站建设制作推广
  • 沈阳医疗网站制作外贸出口网
  • 呼和浩特制作网站做网站服务器价格多少合适
  • 上海专业网站制作设计公司哪家好可做生物试卷的网站
  • 做一款什么网站赚钱自己做视频网站 在优酷推广
  • 网站开发 软件网站制作模板图片
  • 深圳网站页面设计公司深圳高端婚介公司
  • 消费返利系统网站建设电商模板网站
  • 中山网站建设解决方案佛山网络发言人平台
  • 国外网站怎么进入怎么修改wordpress 后台登陆密码
  • 简单手机网站模板企业网站在百度搜索不到
  • 长沙百度网站建设凡科轻站
  • 深圳做英文网站的公司wordpress pagination
  • 一个空间可以做几个网站吗找竞价托管公司
  • 如何找到网站管理员宁波平面设计公司
  • 刷赞网站推广qq免费企业网站备案号密码忘记
  • 合肥网站关键词推广成都百度网站优化
  • 在哪找可以做网站的江苏网站关键词优化优化
  • 高校信息公开网站建设上海网络推广培训机构
  • 各网站收录重庆建设厅网站
  • 凌河网站建设推广扬州市工程建设招标网
  • 医疗网站优化徐州网站开发多少钱
  • 系统模板html四川seo多少钱
  • 自学摄影教程的网站有哪些查询网域名查询