Using toString() with Radix Values : Number Data Type : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Number Data Type »

 

Using toString() with Radix Values



<HTML>
<HEAD>
<TITLE>Number Conversion Table</TITLE>
</HEAD>
<BODY>
<B>Using toString() to convert to other number bases:</B>
<HR>
<TABLE>
<TR>
<TH>Decimal</TH><TH>Hexadecimal</TH><TH>Binary</TH></TR>
<SCRIPT LANGUAGE="JavaScript">
var content = "";
for (var i = 0; i <= 20; i++) {
    content += "<TR>"
    content += "<TD>" + i.toString(10"</TD>"
    content += "<TD>" + i.toString(16"</TD>"
    content += "<TD>" + i.toString(2"</TD></TR>"
}
document.write(content)
</SCRIPT>
</TABLE>
</BODY>
</HTML>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Number Data Type