'Call button code: Sub Click (Source As Button) Dim w As New notesUIWorkspace Dim ui As notesUIdocument Dim jineStr As String Set ui = w.currentDocument Call ui.refresh jineStr = ui.fieldGetText ( "jine") Call ui.fieldSetText ("Dxje", TurnResult (JINESTR)) Call Ui.refreshend Sub
'Conversion function Function TurnResult (numStr As String) As String Dim digi As Integer Dim numLen As Integer numLen = Len (numStr) intStr = Left (numStr, (numLen - 3))' taking the integer part digStr = Right (numStr, 2) 'Take a small number Numlen = LEN (INTSTR) DIGI_OLD = 9' Handling Integer Some Conversion While Numlen <> 0 Digi = CINT (INTSTR, 1)) IF Numlen <5 Ten 'completed by the conversion IF DIGI_OLD = 0 And digi = 0 And numLen <> 1 Then TurnResult = TurnResult Else If digi = 0 And numLen <> 1 Then TurnResult = TurnResult numToBigWrite (digi) Elseif digi = 0 And digi_old = 0 And numLen = 1 Then TurnResult = Left (TurnResult, len (TurnResult) -1) Unit (numLen) Elseif digi = 0 And digi_old <> 0 And numLen = 1 Then TurnResult = TurnResult Unit (numLen) Else TurnResult = TurnResult numToBigWrite (digi) Unit (numLen) End If END IF ELSE 'More than 10,000 yuan above the conversion IF Digi_old = 0 and Digi = 0 and Numlen <> 5 TurnResult = TurnResult else if Digi = 0 and Numlen <> 5 TurnResult = TurnResult NumTobigWrite (DIGI) Else if digi = 0 And digi_old = 0 And numLen = 5 Then TurnResult = Left (TurnResult, Len (TurnResult) -1) Unit (numLen) Elseif digi = 0 And digi_old <> 0 And numLen = 5 Then TurnResult = TurnResult Unit (numLen) Else TurnResult = TurnResult numToBigWrite (digi) Unit (numLen) End If End If End If digi_old = digi intStr = Right - value of the fractional part (intStr, numLen 1) numLen = Len (intStr) Wend 'conversion TurnResult = TurnResult NumTobigWrite (CINT (LEFT (Digstr, 1)))
Unit (-1) _ NumTobigWrite (CINT (Right (Digstr, 1))) Unit (-2) "whole" end function 'unit conversion function Function Unit (Bit as integer) AS STRING SELECT CASE BIT CASE -1 Unit = "angle" case -2 unit = "division" case 1 unit = "yuan" case 2 unit = "Pick up" case 3 unit = "" case 4 unit = "仟" case 5 unit = "10,000" Case 6 Unit = "Pick up" case 7 unit = "" case 8 unit = "仟" case 9 unit = "100 million" case else unit = "invalid" cstr (bit) End Select End Function