wantime
asked on
Javascript: Decimal to Hex Problem
Hello all,
i would like to convert Decimal to Hex.
the problem i met is:
wenn i tried to convert decimal 987654321 to Hex, i get the value 7267464261. What i really wanted are 3AD168B1.
following are codes.
anyone knows where is the problem?
thanks,
wantime
i would like to convert Decimal to Hex.
the problem i met is:
wenn i tried to convert decimal 987654321 to Hex, i get the value 7267464261. What i really wanted are 3AD168B1.
following are codes.
anyone knows where is the problem?
thanks,
wantime
<html>
<body>
<p id="demo"></p>
<script type="text/javascript">
function DecToHex(d) {return d.toString(8)}
window.onload=function() {
var dx = DecToHex(987654321);
document.getElementById("demo").innerHTML= dx;
}
</script>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.