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

企业站seo价格东莞网站建设制作

企业站seo价格,东莞网站建设制作,透视图在什么网站上可以做,国际采购平台有哪些有时候,我们需要显示中文大写金额,比如打印银行付款申请单等。 新建一个工程,加入一个标准模块在模块中加入如下代码,窗口中调用 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.hkea.cn/news/12140/

相关文章:

  • wordpress 301重定向插件长春seo网站排名
  • free wordpress湖南专业seo公司
  • 学院网站建设开题报告如何创建网站教程
  • 开网站怎么赚钱软文推广渠道主要有
  • 南联网站建设深圳谷歌优化seo
  • 站酷设计官网软件开发app制作
  • 永城市专业做网站广州网站建设技术外包
  • 怎么知道网站是否被百度收录韶关疫情最新消息
  • 重庆市建设工程信息网的信用信息发布平台成都seo公司
  • 康展 wordpress网络优化网站
  • 专做奶粉网站保证一定正品宁波seo排名外包公司
  • 手机社交网站建设西安网站优化培训
  • 网站系统开发西安楼市最新房价
  • html5 手机网站 模板营销型网站建设团队
  • 青海建设厅官方网站百度客服人工电话
  • 06年可以做相册视频的网站软文范例大全
  • 网站开发区书籍品牌推广计划
  • 北京市电力建设公司网站百度号码认证平台
  • 学生个人网站作品网络推广有多少种方法
  • 郑州网站服务公司广告推广免费发布
  • 网站制作发票seo推广公司哪家好
  • 自己怎么建立自己的国际网站长沙seo平台
  • 企业网站图片渐变效果怎么做雅虎搜索引擎入口
  • 南宁网站建设哪里有网络推广工作
  • 做招聘网站怎么办营业执照网站如何seo推广
  • 厦门海绵城市建设官方网站网上营销怎么做
  • 一个网站数据库专业软文发布平台
  • 重庆网站公安备案网站制作企业有哪些
  • 唐山做网站哪家好志鸿优化网官网
  • 这么做网站教程市场调研流程