Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
JScript
JScript Reference
JScript Objects
Intrinsic Objects
 JScript Number Object

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
JScript 8.0
JScript Number Object

The primary purpose of the Number object is to collect properties and methods that are used for the default numeric data type, the Number data type. The numeric constants provided by the properties of the Number object are listed in the table below.

Property

Description

MAX_VALUE

Largest possible number, about 1.79E+308; can be positive or negative. (Value varies slightly from system to system.)

MIN_VALUE

Smallest possible number, about 2.22E-308; can be positive or negative. (Value varies slightly from system to system.)

NaN

Special nonnumeric value, "not a number."

POSITIVE_INFINITY

Any positive value larger than the largest positive number (Number.MAX_VALUE) is automatically converted to this value; represented as infinity.

NEGATIVE_INFINITY

Any value more negative than the largest negative number (-Number.MAX_VALUE) is automatically converted to this value; represented as -infinity.

Number.NaN is a special property that is defined as not a number. Number.NaN is returned when an expression that cannot be represented as a number is used in a numeric context. For example, NaN is returned when either the string "Hello" or 0/0 (zero divided by zero) is used as a number. NaN compares as unequal to any number and to itself. To test for a NaN result, do not compare against Number.NaN; use the isNaN method of the Global object instead.

The toLocaleString method of the Number object produces a string value that represents the value of the number formatted as appropriate for the host environment's current locale. The formatting used makes large numbers easier to read by separating groups of digits to the left of the decimal point with a (locale dependent) character. For more information, see toLocaleString Method.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker