hexadecimal--->decimal

Database
Enthusiast

hexadecimal--->decimal

hexadecimal--->decimal 

 

id   16hex   

aaa  28E1

 

 

Result:

id    decimal 

aaa   10465

Tags (1)
3 REPLIES
Senior Apprentice

Re: hexadecimal--->decimal

It would be nice to actually pose a question.

16hex = binary|string?

result = binary|string|numeric?

Enthusiast

Re: hexadecimal--->decimal

Select '28E1',((((((Index('0123456789abcdef',Substr('28E1',
        1,1)) -1) * 16 ) + ((Index('0123456789abcdef',Substr('28E1',
        2,1)) -1) ))* 16) + ((Index('0123456789abcdef',Substr('28E1',
        3,1)) -1) ))* 16) + Index('0123456789abcdef',Substr('28E1',
        4,1)) -1
Enthusiast

Re: hexadecimal--->decimal

SELECT to_number( '28E1', 'xxxxx' )  -- hex to decimal