Hi !
and thank you for writing in a thread of mine.
Just now, i am trying to write a function that could translate decimal numbers into hexadecimal numbers.
Here is the mess :
<!– hexadecimeur –>
<script type=”text/javascript”>
function hexadecimer(decimal)
{
thesaurus = ‘0123456789abcdef’
hexadec_carax = thesaurus.split(”)
var nouveau_caractere = ”
if( decimal-decimal%Math.pow(16, 1) = 0 )
nouveau_caractere = decimal%16
else
reste = decimal – decimal%Math.pow(16, 1)
if(reste-decimal%Math.pow(16, 2) = 0)
nouveau_caractere = 0
else
reste = decimal-decimal%Math.pow(16, 2)
i = 6
while( i > 0 )
{
if( decimal-decimal%Math.pow(16, i) = 0 )
hexadec_carac = hexadec_carax[decimal%16
hexadecimal += hexadec_carac[decimal%Math.pow(16, i)]
i–
}
return hexadecimal
}
alert(hexadecimer(256))
</script>
<!–fin hexadecimeur –>
If you want to give a hand !
Grand Mamamouch