Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert hexa to decimal
Message
From
13/06/2008 01:39:14
 
 
To
12/06/2008 09:58:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01323395
Message ID:
01323706
Views:
15
Thank you Gregory,
but it's in vfp6, so I can't use strconv() function.

I found on web, maybe useful for somebody else, who uses oracle:

create or replace function to_dec ( p_str in varchar2, p_from_base in number default 16 ) return number
is
l_num number default 0;
l_hex varchar2(16) default '0123456789ABCDEF';
begin
if ( p_str is null or p_from_base is null )
then
return null;
end if;
for i in 1 .. length(p_str) loop
l_num := l_num * p_from_base + instr(l_hex,upper(substr(p_str,i,1)))-1;
end loop;
return l_num;
end

sqlexec(h,"select to_char(to_dec('84028A8918BE04')) from dual")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform