Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Number Object toString Method

Converts a Number object or variable into a string using the specified radix.

Syntax: JScript Number Object toString Method

number.toString([radix])

Arguments: JScript Number Object toString Method

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: JScript Number Object toString Method

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

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.