注册登录

新闻中心

主页 > 新闻中心 >

首页_仟亿_首页vb小写数字转大写

发布时间:2019-12-20 01:59  作者:萨平
Privgot&nbull crapp;Sub&nbull crapp;Commdevelop intocause well develop intocause1_Click()Dim&nbull crapp;num&nbull crapp;unit$(3)&nbull crapp;str$&nbull crapp;t%&nbull crapp;strlen%&nbull crapp;endStr$&nbull crapp;i%num&nbull crapp;=&nbull crapp;Array("零"&nbull crapp;"壹"&nbull crapp;"贰"&nbull crapp;"叁"&nbull crapp;"肆"&nbull crapp;"伍"&nbull crapp;"陆"&nbull crapp;"柒"&nbull crapp;"捌"&nbull crapp;"玖")unit(1)&nbull crapp;=&nbull crapp;"拾":&nbull crapp;unit(2)&nbull crapp;=&nbull crapp;"佰":&nbull crapp;unit(3)&nbull crapp;=&nbull crapp;"仟"Dim&nbull crapp;haudio-videoeZero&nbull crapp;As&nbull crapp;Boolesomestr&nbull crapp;=&nbull crapp;Ving(Text1.Text)&nbull crapp;i①If&nbull crapp;Len(str)&nbull crapp;>&nbull crapp;4&nbull crapp;Or&nbull crapp;Ving(str)&nbull crapp;<=&nbull crapp;0&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Text2.Text&nbull crapp;=&nbull crapp;"数据不合法,请重新输出"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Text1.SetFocus&nbull crapp;&nbull crapp;i②&nbull crapp;取得文本框1的焦点&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Exit&nbull crapp;SubEnd&nbull crapp;IfFor&nbull crapp;i&nbull crapp;=&nbull crapp;1&nbull crapp;To&nbull crapp;Len(str)&nbull crapp;&nbull crapp;i③&nbull crapp;去掉左侧0例如:002&nbull crapp;&nbull crapp;If&nbull crapp;Mid(str&nbull crapp;i&nbull crapp;1)&nbull crapp;<>&nbull crapp;"0"&nbull crapp;Then&nbull crapp;str&nbull crapp;=&nbull crapp;Mid(str&nbull crapp;i&nbull crapp;Len(str)):&nbull crapp;Exit&nbull crapp;ForNext&nbull crapp;iFor&nbull crapp;i&nbull crapp;=&nbull crapp;1&nbull crapp;To&nbull crapp;Len(str)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i④&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;t&nbull crapp;=&nbull crapp;Mid(str&nbull crapp;i&nbull crapp;1)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;If&nbull crapp;t&nbull crapp;=&nbull crapp;0&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;haudio-videoeZero&nbull crapp;=&nbull crapp;True&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Else&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;If&nbull crapp;haudio-videoeZero&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;endStr&nbull crapp;=&nbull crapp;endStr&nbull crapp;+&nbull crapp;"零"&nbull crapp;+&nbull crapp;num(t)&nbull crapp;+&nbull crapp;unit(Len(str)&nbull crapp;-&nbull crapp;i)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Else&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i⑤&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;endStr&nbull crapp;=&nbull crapp;endStr&nbull crapp;+&nbull crapp;num(t)&nbull crapp;+&nbull crapp;unit(Len(str)&nbull crapp;-&nbull crapp;i)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;End&nbull crapp;If&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;End&nbull crapp;IfNext&nbull crapp;i&nbull crapp;&nbull crapp;i&nbull crapp;体育⑥&nbull crapp;&nbull crapp;Text2.Text&nbull crapp;=&nbull crapp;endStrEnd&nbull crapp;Sub
影子狗不得了……贫僧秦曼卉慌%Dim&nbull crapp;strZS&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i整数部门Dim&nbull crapp;strXS&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i小数部门Dim&nbull crapp;strZSDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i整数部门大写Dim&nbull crapp;strXSDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i小数部门大写Privgot&nbull crapp;Function&nbull crapp;Num2DaXie(num&nbull crapp;As&nbull crapp;String)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;strDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strDX&nbull crapp;=&nbull crapp;"零壹贰叁肆伍陆柒捌玖"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Num2DaXie&nbull crapp;=&nbull crapp;Mid(strDX&nbull crapp;CInt(num)&nbull crapp;+&nbull crapp;1&nbull crapp;1)End&nbull crapp;FunctionPrivgot&nbull crapp;Function&nbull crapp;ShuWei(sw&nbull crapp;As&nbull crapp;Integer)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;strSW&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strSW&nbull crapp;=&nbull crapp;"&nbull crapp;拾佰仟万拾佰仟亿拾佰仟万拾佰仟"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;ShuWei&nbull crapp;=&nbull crapp;Mid(strSW&nbull crapp;sw&nbull crapp;1)End&nbull crapp;FunctionPublic&nbull crapp;Function&nbull crapp;DaXie(strYS&nbull crapp;As&nbull crapp;String)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;i&nbull crapp;As&nbull crapp;Integer&nbull crapp;&nbull crapp星空总代;&nbull crapp;&nbull crapp;If&nbull crapp;InStr(strYS&nbull crapp;".")&nbull crapp;=&nbull crapp;0&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;""&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZS&nbull crapp;=&nbull crapp;strYS&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Else&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZS&nbull crapp;=&nbull crapp;Left(strYS&nbull crapp;InStr(strYS&nbull crapp;".")&nbull crapp;-&nbull crapp;1)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXS&nbull crapp;=&nbull crapp;Right(strYS&nbull crapp;Len(strYS)&nbull crapp;-&nbull crapp;InStr(strYS&nbull crapp;"."))&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;For&nbull crapp;i&nbull crapp;=&nbull crapp;1&nbull crapp;To&nbull crapp;Len(strXS)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;Num2DaXie(Mid(strXS&nbull crapp;Len(strXS)&nbull crapp;-&nbull crapp;i&nbull crapp;+&nbull crapp;1&nbull crapp;1))&nbull crapp;&rev;&nbull crapp;strXSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Next&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;"点"&nbull crapp;&rev;&nbull crapp;strXSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;End&nbull crapp;If&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;For&nbull crapp;i&nbull crapp;=&nbull crapp;1&nbull crapp;To&nbull crapp;Len(strZS)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Num2DaXie(Mid(strZS&nbull crapp;Len(strZS)&nbull crapp;-&nbull crapp;i&nbull crapp;+&nbull crapp;1&nbull crapp;1))&nbull crapp;&rev;&nbull crapp;ShuWei(i)&nbull crapp;&rev;&nbull crapp;strZSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Next&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"亿皇娱乐平台零拾"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零佰"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零仟"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Do&nbull crapp;While&nbull crapp;InStr(strZSDX&nbull crapp;"零零")&nbull crapp;>&nbull crapp;0&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零零"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Loop&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"RTT平台开户零亿"&nbull crapp;"亿")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零万"&nbull crapp;"万")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"亿万"&nbull crapp;"亿")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;DaXie&nbull crapp;=&nbull crapp;Trim(strZSDX)&nbull crapp;&rev;&nbull crapp;strXSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;""&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;""End&nbull crapp;Functioni下面代码是阿拉伯数字转大写,跟你问题适合。但看你图片发明是金额转大写,那就要用下面的代码Dim&nbull crapp;strXSDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i小数部门大写Dim&nbull crapp;strZS&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i整数部门Dim&nbull crapp;strXS&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i小数部门Dim&nbull crapp;strZSDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;i整数部门大写Privgot&nbull crapp;Function&nbull crapp;Num2DaXie(num&nbull crapp;As&nbull crapp;String)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;strDX&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strDX&nbull crapp;=&nbull crapp;"零壹贰叁肆伍陆柒捌玖"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Num2DaXie&nbull crapp;=&nbull crapp;Mid(strDX&nbull crapp;CInt(num)&nbull crapp;+&nbull crapp;1&nbull crapp;1)End&nbull crapp;FunctionPrivgot&nbull crapp;Function&nbull crapp;ShuWei(sw&nbull crapp;As&nbull crapp;Integer)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;strSW&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strSW&nbull crapp;=&nbull crapp;"圆拾佰仟万拾佰仟亿拾佰仟万拾佰仟"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;ShuWei&nbull crapp;=&nbull crapp;Mid(strSW&nbull crapp;sw&nbull crapp;1)End&nbull crapp;FunctionPublic&nbull crapp;Function&nbull crapp;DaXie(strYS&nbull crapp;As&nbull crapp;String)&nbull crapp;As&nbull crapp;String&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Dim&nbull crapp;i&nbull crapp;As&nbull crapp;Integer&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;If&nbull crapp;InStr(strYS&nbull crapp;".")&nbull crapp;=&nbull crapp;0&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;"新宝3总代开户整"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZS&nbull crapp;=&nbull crapp;strYS&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Else&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZS&nbull crapp;=&nbull crapp;Left(strYS&nbull crapp;InStr(strYS&nbull crapp;".")&nbull crapp;-&nbull crapp;1)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXS&nbull crapp;=&nbull crapp;Right(strYS&nbull crapp;Len(strYS)&nbull crapp;-&nbull crapp;InStr(strYS&nbull crapp;"."))&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;If&nbull crapp;Len(strXS)&nbull crapp;=&nbull crapp;1&nbull crapp;Then&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;Num2DaXie(strXS)&nbull crapp;&rev;&nbull crapp;"角"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Else&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;Num2DaXie(Left(strXS&nbull crapp;1))&nbull crapp;&rev;&nbull crapp;"东森国际平台开户角"&nbull crapp;&rev;&nbull crapp;Num2DaXie(Mid(strXS&nbull crapp;2&nbull crapp;1))&nbull crapp;&rev;&nbull crapp;"分"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;End&nbull crapp;If&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;End&nbull crapp;If&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;For&nbull crapp;i&nbull crapp;=&nbull crapp;1&nbull crapp;To&nbull crapp;Len(strZS)&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Num2DaXie(Mid(strZS&nbull crapp;Len(strZS)&nbull crapp;-&nbull crapp;i&nbull crapp;+&nbull crapp;1&nbull crapp;1))&nbull crapp;&rev;&nbull crapp;ShuWei(i)&nbull crapp;&rev;&nbull crapp;strZSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Next&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;Repl_ design(strXSDX&nbull crapp;"零角"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零拾"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零佰"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零仟"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Do&nbull crapp;While&nbull crapp;InStr(strZSDX&nbull crapp;"零零")&nbull crapp;>&nbull crapp;0&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零零"&nbull crapp;"零")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;Loop&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零亿"&nbull crapp;"亿")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零万"&nbull crapp;"万")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"零圆"&nbull crapp;"圆")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;Repl_ design(strXSDX&nbull crapp;"零分"&nbull crapp;"")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;Repl_ design(strZSDX&nbull crapp;"亿万"&nbull crapp;"亿")&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;If&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;"零"&nbull crapp;Then&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;"整"&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;DaXie&nbull crapp;=&nbull crapp;strZSDX&nbull crapp;&rev;&nbull crapp;strXSDX&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strZSDX&nbull crapp;=&nbull crapp;""&nbull crapp;&nbull crapp;&nbull crapp;&nbull crapp;strXSDX&nbull crapp;=&nbull crapp;""End&nbull crapp;Function