IT. Expert System.

Java Script

toString()


Description

The toString() method is used to convert a Number object to a string, and return the result.

This method has the form:

number.toString(radix)
Parameter Description
radix (optional) Which base to use for representing a numeric value. Must be an integer between 2 and 36.
  • 2 - The number will show as a binary value
  • 8 - The number will show as an octal value
  • 16 - The number will show as an hexadecimal value

Note: This method is called by JavaScript automatically whenever a Number object needs to be displayed as a string.

Examples

The following example shows the basic use of this method.

<script>
var num = new Number(15);
document.write(num.toString());
document.write("<br />");
document.write(num.toString(2));
document.write("<br />");
document.write(num.toString(8));
document.write("<br />");
document.write(num.toString(16));
document.write("<br />");
</script>

This produces the following result:

Browser Support

Firefox IE Chrome Opera Safari


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 129 / 158763793. Delta: 0.00338 с