Click to See Complete Forum and Search --> : Decimal to Binary Conversion IE Problem


skilled1
08-01-2006, 12:06 PM
Works just fine in firefox, chokes in IE, can someone take a look and see what i messed up

example:
http://www.landsberger.com/assignment5/assignment5.html

netbuddy
08-01-2006, 01:04 PM
Converting number bases...

you only need the use of the toString() to convert numbers and other bases to other number bases like binary, the routines in your page are not needed, you only need to get the number in the box, test it for negative values and then if positive, use toString(2); to convert to base 2 (Binary)

<html>
<head></head>
<script>
myNumber = 8;
myBinary = myNumber.toString(2);
document.write('binary: '+myBinary);
</script>
<body>
</body>
</html>