Navigator 3.0
number.toString([radix])
This optional argument specifies the base that should be used to convert the number. It should be an integer between 2 and 16. If no value is specified, then base 10 is used.
The string representation of the number in the specified radix.
The toString() method of the Number object converts a Number to a string, using the specified radix or base. If no radix is specified, base 10 is used.
Because JavaScript automatically converts numeric values to temporary Number objects when needed, you can use the toString() method on numbers, even though they are primitive types rather than true JavaScript objects:
n =index.html 123; s = n.toString(16);
Note, however, that because of syntactic restrictions in the language, you cannot use the toString() method on numeric literals. You must assign them to variables first; i.e., you cannot rewrite the two lines of code above as:
s =index.html 123.toString(16);
file: /Techref/language/JAVA/SCRIPT/definitive/refp_272.htm, 5KB, , updated: 2019/10/14 15:00, local time: 2024/11/30 22:44,
18.119.192.2:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/language/JAVA/SCRIPT/definitive/refp_272.htm"> [Chapter 21] Reference: Number.toString()</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.