|
|
Q146 How can I convert a decimal number into a hexidecimal number?
irt.org | Knowledge Base | JavaScript | Number | Q146 [ previous next ] Q146 How can I convert a decimal number into a hexidecimal number?The following script will convert any decimal number to a any base upto 36:
Martin Honnen kindly pointed out the following solution:
However, as Jukka Korpela points out: it seems to me that at least on Internet Explorer 3.0 and Opera 3.60, the parameter (16) is ignored - and this means getting the wrong result without any warning. Since the toString solution is probably commonly suggested, perhaps it's useful to mention but with a warning that it does not work on all browsers, so it's better to use another solution. |
-- div -->
|