Полезная информация

Microsoft® JScript™
toString Method (Number)
 Language Reference 
Version 2 

See Also                  Applies To

Converts a Number object or numeric variable into a string using the specified radix.
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.

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( );

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.