Results 1 to 7 of 7

Thread: Conversions - Dec to Hex, Oct, Bin

  1. #1

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Resolved Conversions - Dec to Hex, Oct, Bin

    How can i convert the following?

    • Decimal to Hexadecimal

    • Decimal to Octal

    • Hexadecimal to Decimal

    • Octal to Decimal
    Last edited by x-ice; Jul 21st, 2005 at 09:28 AM.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Conversions - Dec to Hex, Oct, Bin



    Has someone helped you? Then you can Rate their helpful post.

  3. #3

    Thread Starter
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: Conversions - Dec to Hex, Oct, Bin

    Quote Originally Posted by manavo11
    Ok i dont understand the conversion from decimal to hex, can anyone explain? (nevermind, i get it now)
    Last edited by x-ice; Jul 19th, 2005 at 10:34 AM.

  4. #4
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Re: Conversions - Dec to Hex, Oct, Bin

    I want to convert contents of a text box from decimal to binary... how do i do this?
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Conversions - Dec to Hex, Oct, Bin

    First convert the string to numeric data type. (Long)
    Then see post#3 of this very old thread.

    Also, for VB.NET see this this thread.

    For working with ONLY small numbers see this thread.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  6. #6
    PowerPoster Halsafar's Avatar
    Join Date
    Jun 2004
    Location
    Saskatoon, SK
    Posts
    2,339

    Re: Conversions - Dec to Hex, Oct, Bin

    ABC (base 16) to base 10 = (12 * 16^0) + (11 * 16^1) + (10 * 16^2) = 2748

    2748 (base 10) to base 16
    = 2748 / 16 = 171 remainder 12
    = 171 / 16 = 10 remainder 11
    = 10 / 16 = 0 remainder 10

    Convert the remainders into the proper letters and place them bottom to top.

    10, 11, 12 = ABC


    This conversion works fine in any scenerio. Just replace the 16 with whatever base you want. You must use ints however, double precision division will corrupt this.
    "From what was there, and was meant to be, but not of that was faded away." - - Steve Damm

    "The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm

    "When you do things right, people won't be sure if you did anything at all." - - God from Futurama

  7. #7
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Re: Conversions - Dec to Hex, Oct, Bin

    thx all got it sorted!
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

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