Results 1 to 4 of 4

Thread: Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    219

    Post

    Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?

  2. #2
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    593

    Post

    See:

    http://www.vb-world.net/tips/tip109.html

    ------------------
    John Percival
    Editor, VB-World.net
    john@vb-world.net



  3. #3
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    593

    Post

    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



  4. #4
    New Member
    Join Date
    Jul 2010
    Posts
    1

    Re: Turn Binary # To Decimal Number Like How 10110 = 22 how can i do that ?

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width