Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert hexa to decimal
Message
 
 
À
12/06/2008 09:58:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01323395
Message ID:
01323706
Vues:
16
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")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform