1 Reply Latest reply on Aug 4, 2006 6:38 AM by Newsgroup_User

# decimal to hexa conversion

hi

i want to convert the large decimal number into hexa

like
3054452055 ======b60f3d57

i made the script but its not working on large numbers

----------and another problem is that director can pick 10 digits number it only take 9 digits

plz tell me the script which easilt convert the decimal to hexa

on convert_dectohexa num

sys="123456789ABCDEF"

Num3=(num)
put "Num3="&Num3

divd=float(Num3/16)
put "1--divd=" & divd

Rmd=float(Num3 mod 16)

if Rmd = 0 then
D_to_H = string( Rmd )
else
D_to_H = D_to_H & sys.char[Rmd]
end if

put "1--Rmd="&Rmd

put "1--D_to_H="&D_to_H

repeat while divd >15
Rmd=float(divd mod 16)
divd=float(divd/16)
put "2--divd=" & divd

if Rmd = 0 then
D_to_H = string( Rmd ) & D_to_H
else
D_to_H = sys.char[Rmd] & D_to_H
end if

put "2--Rmd="&Rmd

put "2--D_to_H="&D_to_H

end repeat

D_to_H = sys.char[divd] & D_to_H
put D_to_H

return D_to_H

end

i m waiting for the reply
thx
• ###### 1. Re: decimal to hexa conversion
The largest number you can use, as a number, is what's called the
maxInteger, which is: 2147483647
If you want to use 'numbers' larger than this, you will need to use