Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?
Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?
See:
http://www.vb-world.net/tips/tip109.html
------------------
John Percival
Editor, VB-World.net
[email protected]
Try this:
Dim strbin As String
Dim lngnum As Long
Dim x As Integer
strbin = "1001"
For x = 1 To Len(strbin)
If Mid(strbin, x, 1) = "1" Then lngnum = lngnum + 2 ^ (Len(strbin) - x)
Next
------------------
John Percival
Editor, VB-World.net
[email protected]
I need any kind of program that can take a huge (1 MB) text file of a single, no-breaks binary number, and turn it into a decimal number.
Anything helps!