Click to See Complete Forum and Search --> : Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?
XxEvilxX
Jan 15th, 2000, 05:10 AM
Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?
John
Jan 15th, 2000, 07:11 AM
See:
http://www.vb-world.net/tips/tip109.html
------------------
John Percival
Editor, VB-World.net
john@vb-world.net
John
Jan 15th, 2000, 07:16 AM
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
john@vb-world.net
fbplayer070
Jul 13th, 2010, 10:37 AM
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!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.