Dim sTemp As String = vbNullString Dim sTemp2 As String = vbNullString Dim iMaxLen As Integer = 4 Dim iPos As Integer = 0 sTemp = TextBox1.Text If sTemp <> vbNullString Then If sTemp.StartsWith("1") Then iMaxLen = 4 Else iMaxLen = 3 End If
If Len(sTemp) > iMaxLen Then If InStr(sTemp, ".") > 0 And InStr(sTemp, ".") < iMaxLen Then iMaxLen = iMaxLen + 1 sTemp = Microsoft.VisualBasic.Left$(sTemp, iMaxLen) ElseIf InStr(sTemp, ".") > iMaxLen Then sTemp2 = Microsoft.VisualBasic.Left$(sTemp, InStr(sTemp, ".")) sTemp = Microsoft.VisualBasic.Left$(sTemp2, iMaxLen) For iPos = iMaxLen To Len(sTemp2) sTemp = sTemp & "0" Next ElseIf InStr(sTemp, ".") = iMaxLen Then sTemp = Microsoft.VisualBasic.Left$(sTemp, iMaxLen + 1) End If End If
TextBox1.Text = sTemp End If
|
No responses found. Be the first to respond and make money from revenue sharing program.
|