Convert Hex to Decimal

Results 1 to 2 of 2

Thread: Convert Hex to Decimal

  1. #1
    Join Date
    Dec 1969

    Default Convert Hex to Decimal

    There&#039;s a Hex function (and an Oct function) but I can&#039;t find any way to convert a Hex number back to it&#039;s decimal form.<BR><BR>Is there a built in function I&#039;m not finding?<BR><BR><BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default I used a trick.

    Say you have the Hex equivelent of 455 (1C7) as a string. (Which is what the Hex function returns).<BR><BR>Append &H to the front of it, and then you can do a CDbl, or CLng on it to convert it back to decimal.<BR><BR>Like so:<BR><BR>&#060;%<BR>&#039;455 as hex<BR>HexNum = Hex(455)<BR>&#039;Add the identifier<BR>HexString = "&H" & HexNum<BR>&#039;Convert to int<BR>DecNum = CLng(HexString)<BR>Response.Write(DecNum)<BR>%&#06 2;<BR><BR> <BR><BR>

Posting Permissions

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