Convert Integer to strings

[Total: 0    Average: 0/5]

This file shows how to convert any integer into a string equivelant in any base up to and including base 36.

Body Code:

<script type=text/javascript>
var num=128
var numDec = num.toString()
var numOct = num.toString(8)
var numHex = num.toString(16)
var numBase4 = num.toString(4)
document.write('<BR><BR>Output of the code is as follows:<BR><BR></div><div class=result>')
// base 36 is the max
var x=0
for (var i=2;i<36;i++) {
  if (!(i%5)) x = "<BR>"; else x = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *