Microsoft JScript
toString Method (Number)
Language Reference
Version 2

See Also Applies To


Description
Converts a Number object or numeric variable into a string using the specified radix.
Syntax
number.toString([ radix ]);

The toString method syntax has these parts:

Part Description
number A Number object or variable. Cannot be a numeric literal.
radix An optional argument specifying the base to use when converting the number. Values between 2 and 16 inclusive are accepted. If not supplied, base 10 is used.
Remarks
Due to syntax restrictions, the toString method cannot be used on numeric literals. Values must be assigned to variables first. For example, the following code is invalid:

str = 1997.toString( );


This code must be rewritten:

var yr = 1997;
str = yr.toString( );



Comments