[HELP]Hex -> Dec

Joined
Apr 8, 2007
Messages
808
Reaction score
15
Heya,

I really don't code at all... So I came here to ask you people :)

I've got like 3xx rows of Hexadecimal data... I want to converted to Decimal.

I tryed doing that in Excel, that worked out well... BUT
Excel wouldn't convert the data like:
10A1
11A1
etc...

Does anyone know how to do this?

Thnx in advance :)
 
X in base Y =
((X / Y^0) % (Y^1)) ((X / Y^1) % (Y^2)) ((X / Y^2) % (Y^3))....

For hex, its:
X in base 16 =
((X / 1) % 16) ((X / 16) % 16^2) ((X / 16^2) % 16^3) and so on.

For example, 100 in base 16
= ((100 / 1) % 16) ((100/16)%256)
= 4 6

Of course you'll need to reverse the digits to get 100 = 64 in base 16. Note that for every division you round the final value down no matter what.

2
 
Oh wait your asking for the other way round! Heh.
To do so, let Dn denote the nth digit of a hex value IN REVERSE, starting with d = 0.

For example in 12ACB, D0 = B, D1 = C, D2 = A, D3 = 2, D4 = 1

Then value in dec = D0 * 16^0 + D1 * 16^1 + D2 ^ 2 all the way to n = 4.

2
 
@kreain, for some reason that function did not work, but thanks.
@Jash, then I still don't know what to do :P

But I solved it with Google, found a custom made module that did the trick ^^
 
@kreain, for some reason that function did not work, but thanks.
@Jash, then I still don't know what to do :P

But I solved it with Google, found a custom made module that did the trick ^^

You know, its useful to learn some coding as it can be used for many general purpose like the problem you posted above ^^

Basically once you know how to convert HEX -> DEC, you can just write a program which processes the hex values and converts them into dec.

2
 
You know, its useful to learn some coding as it can be used for many general purpose like the problem you posted above ^^

Basically once you know how to convert HEX -> DEC, you can just write a program which processes the hex values and converts them into dec.

2

I know, and I'm willing to learn, but for my study I don't really need to do this kind of stuff very often, like never :P
Only need it when I'm doing Private Server projects for fun :)
But thanks Jash ^^
 
Back