Aurelyyy
Messages postés4Date d'inscriptionjeudi 19 décembre 2002StatutMembreDernière intervention19 février 2003
-
23 janv. 2003 à 14:47
Aurelyyy
Messages postés4Date d'inscriptionjeudi 19 décembre 2002StatutMembreDernière intervention19 février 2003
-
27 janv. 2003 à 09:02
Salut,
dans ma base SQL j'ai un identifiant salarié qui est en base 36.
ex : 17C, 17 D ect...
et il faut que je le passe en base 10.
Es ce que qq1 aurait la formule en asp? SVP.
MERCI
cs_Mcjo
Messages postés403Date d'inscriptiondimanche 12 août 2001StatutMembreDernière intervention 3 septembre 20122 23 janv. 2003 à 18:25
c'est quoi la base 36??
je connais la base 2, 8, 10, 16 mais la je suis sotcher
si j'ai tout compris 0 en base 36 vaut 0 et z vaut 36
donc la c'est pas compliquer tu applique la formule de conversion par puissance
cs_Mcjo
Messages postés403Date d'inscriptiondimanche 12 août 2001StatutMembreDernière intervention 3 septembre 20122 24 janv. 2003 à 15:13
Non mais avec un peu de chance tu doit pouvoir en trouver pour convertir de l'hexa en base 10.
Il te sufirat alors de le modifier un peu
function puissance(a, b)
puissance = 1
if b > 0 then
for = 1 to b
puissance = puissance * a
next
end if
end function
function convertion(a)
if isnumeric(a) then convertion = cint(a)if a "a" then convertion 10if a "b" then convertion 11if a "c" then convertion 12if a "d" then convertion 13if a "e" then convertion 14if a "f" then convertion 15if a "g" then convertion 16if a "h" then convertion 17if a "i" then convertion 18if a "j" then convertion 19if a "k" then convertion 20if a "l" then convertion 21if a "m" then convertion 22if a "n" then convertion 23if a "o" then convertion 24if a "p" then convertion 25if a "q" then convertion 26if a "r" then convertion 27if a "s" then convertion 28if a "t" then convertion 29if a "u" then convertion 30if a "v" then convertion 31if a "w" then convertion 32if a "x" then convertion 33if a "y" then convertion 34if a "z" then convertion 35
end function
function base10(base36)
dim matable
redim matable len(base36)
for i = 1 to len(base36) step 1
matable(i) = mid(base36,i,1)
next
redim matable2(ubound(matable))
j = ubound(matable)
for i = 1 to ubound(matable2)
matable2(i) = matable(j)
j = j - 1
next
for i = 1 to ubound(matable2)
base10 = base10 +puissance(convertion(matable(i)), i - 1)
next