> I need to convert a binary number to Hex, and vice-versa. It's been a
long
> time since I've done this. Does anyone have some code that will do this
for
> me?
>
> The binary number will look something like: 1100001111010001 (It will be
as
> much as 16 digits)
I just wrote this program. It will covert a number from one base to another
whatever the base is. Check it out. You might want to test it, I didn't
had enough time but it seems to work so far.
If you want to convert a binary number like 10101101 to hex, call
the function like this :
?Base2Base('10101101',2,16)
For a hex2bin conversion :
?Base2Base('FF',16,2)
For all : If you think this might be usefull for somebody else
I will upload it on UT.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement