Export (0) Print
Expand All

toString Method (Number)

Returns a string representation of a number.

number.toString()

number

Required. The number to represent as a string.

The string representation of the number.

The following example illustrates the use of the toString method with a number.

var number = 234.567;
var s = number.toString();
document.write(s.length);

// Output: 7

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Show:
© 2014 Microsoft