Gold amount uppercase conversion

zhaozj2021-02-08  209

Seeing the amount of the previous amount, I also wrote a time, I wrote a one, there is not much number of people written in a hurry, and there is a mistake, please advise. Entrance: getChangeDVal

Option Explicit 'Overall Ideas:' Treatment of the number, the grade is 4 'for each level of the classification, and the string is connected to the string, and the string is connected to', such as: 123456 = 12 | 3456 'second level: 12 = 壹 "10,000" first level: 3456 = 千 百 伍 陆 陆 ""

Private const prvstrnum = "贰 柒捌 玖" private const prvstrunit = "10,000 thousand pickers" private const prvstrgradeunit = "Ten billion" "" 兆 千 千 "private const prvgrade = 4

Public Function getChangedVal (ByVal StrVal As String) As String Dim StrDotUnit As String Dim StrIntUnit As String StrDotUnit = getDotUnit (StrVal) 'takes decimal places StrIntUnit = getIntUnit (StrVal)' takes an integer bit StrIntUnit = getIntUpper (StrIntUnit) 'bit integer conversion uppercase StrDotUnit = getDotupper (strintUnit) 'Digital Converter GetChangeDval = StrintUnit & StrDotunitEnd Function

Private Function getDotUnit (ByVal StrVal As String) As String 'obtained digits after the decimal point Dim StrRet As String Dim IntBegin As Integer Dim IntLen As Integer IntBegin = InStr (1, StrVal, ".") 1 IntLen = Len (StrVal) 1 strRet = Mid (strVal, IntBegin, IntLen - IntBegin) If IntBegin> 1 Then getDotUnit = strRet End IfEnd FunctionPrivate Function getIntUnit (ByVal strVal As String) As String 'obtained integer number Dim strRet As String Dim IntBegin As integer Dim IntLen As integer 'The length of the decimal number INTBEGIN = LEN (GETDOTUNIT (STRVAL)) INTLEN = LEN (STRVAL) STRET = MID (Strval, 1, INTLEN - INTBEGIN)' total string length - decimal number length = integer number length IF MID (Strret , Len (Strret), 1) = "." THEN 'Remove the end of the decimal point STRET = MID (Strret, 1, LEN (STRET) - 1) end if getIntunit = Strretend Function

Private Function GetInTupper (Byval Strig AS String) AS String 'Get translated uppercase (integer part) DIM INTGRADE AS INTEGER' level DIM STRING AS STRING DIM STRTMP AS STRING 'Get the current class, Intgrade = FIX (Len (Strval) / Prvgrade) 'Adjustment Level Length IF (Len (Strval) Mod Prvgrade <> 0 THEN INTGRADE = INTGRADE 1 End if' MSGBox MID (PRVSTRGRADEUNIT, INTGRADE, 1) DIM I AS INTEGER 'Treatment for each stage = INTGRADE TO 1 Step -1 Strtmp = GetNowGradeval (Strval, i) 'gets the current level digital strret = strret & getSubunit (strtmp)' conversion uppercase STRET = Dropzero (STRRET) 'divided to zero' plus secondary unit IF i> 1 Then 'the last position is uniform' unit can't be connected continuous "?????????????????????????? 'Strret = Strret & Mid (PrvstrGradeUnit, I, 1) end if next getintupper = strretend function

Private Function getDotUpper (ByVal StrVal As String) As String 'obtained uppercase (fractional part) converted End FunctionPrivate Function dropZero (ByVal StrVal As String) As String' removed even following "zero" Dim StrRet As String Dim StrBefore As String ' Front position character DIM STRNOW AS STRING 'Today Position Character DIM I as Integer Strbefore = MID (Strval, 1, 1) Strret = StrBefore for i = 2 to Len (Strnow = MID (Strval, I, 1) IF STRNOW = "zero" And StrBefore = "zero" Then 'zero simultaneously Else strRet = strRet & StrNow End If StrBefore = StrNow Next' the last one to zero Dim IntLocate As Integer IntLocate = Len (strRet) 'IntLocate = IIf (IntLocate = 0 , 1, IntLocate) If Mid (strRet, IntLocate, 1) = "zero" Then strRet = Left (strRet, Len (strRet) - 1) End If dropZero = StrRetEnd FunctionPrivate Function getSubUnit (ByVal strVal As String) As String 'value Conversion Debug.Print Strval Dim Intlen As INTEger Dim i AS Integer Dim StrKey As Str ING DIM STRET AS STRING DIM INTKEY As INTLEN = LEN (STRVAL) for i = 1 To intlen strkey = MID (Strval, I, 1) INTKEY = VAL (STRKEY) IF INTKEY = 0 THEN '"zero" is special processing IF I <> intlen Ten 'conversion number of ends cannot be zero strret = strret & "zero" end if else' if intKey = 1 and i = 2 TEN '"拾" as special processing' "拾" rationally 'ELSE Strret = Strret & Mid (PrvStrnum, Val (StrKey), 1) '

转载请注明原文地址:https://www.9cbs.com/read-2962.html

New Post(0)