CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: HEX2DEC

  1. #1
    Guest

    HEX2DEC

    Hi,
    who knows a fast and easy way to convert a hex number into a decimal number.


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: HEX2DEC

    use VAL but make sure that your number is prefixed by "&H"
    ie

    dim Hexnumber,decnumber
    hexnumber=hex(15)
    decnumber=val(hexnumber)
    'this will return 0
    'but if you do this
    hexnumber="&H" & hexnumber
    decnumber=val(hexnumber)
    'this will return 15



    Hope this 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

Featured