- Home
·
- Math/Dates
·
- changes decimal values to 36 base (0-9 + A-Z) Six digit number can be expressed in just 4.
changes decimal values to 36 base (0-9 + A-Z) Six digit number can be expressed in just 4.
changes decimal values to 36 base (0-9 + A-Z) Six digit number can be expressed in just 4.
Rate changes decimal values to 36 base (0-9 + A-Z) Six digit number can be expressed in just 4.
(2(2 Vote))
'Names: label1, command1, text1
Private Sub Command1_Click()
'get the value of your string entered in
' to the textbox
'left function takes only first 6 digit
' of the number (in case you typed more th
' en 6)
num = Val(Left(Text1, 6))
a = Int(num / 36 ^ 3)
b = Int((num - a * 36 ^ 3) / 36 ^ 2)
c = Int(((num - a * 36 ^ 3) - b * 36 ^ 2) / 36 ^ 1)
d = num - a * 36 ^ 3 - b * 36 ^ 2 - c * 36 ^ 1
'ASCII uses 0-9 then a-z then A-Z, we wa
' nt to skip the lower case font
a = a + 48
If a > 57 Then a = a + 7
b = b + 48
If b > 57 Then b = b + 7
c = c + 48
If c > 57 Then c = c + 7
d = d + 48
If d > 57 Then d = d + 7
Label1.Caption = "36 base: " & Chr(a) & Chr(b) & Chr(c) & Chr(d)
'code by Szymon Machajewski
'Grand Rapids Comm College
'Network Support Tech 1
'[email protected]
End Sub
changes decimal values to 36 base (0-9 + A-Z) Six digit number can be expressed in just 4. Comments
No comments yet — be the first to post one!
Post a Comment