Java Reference
In-Depth Information
Table 4-13. The List of Properties and Method of the Number Object with Their
Descriptions
Property/Method
Description
Number.MAX_VALUE
It is the largest positive, finite value of the Number type.
It is approximately 1.7976931348623157e+308
Number.MIN_VALUE
It is the smallest positive, finite value of the Number
type. It is approximately 4.9e-324
Number.NaN
It is same as the global variable NaN that represents
non-a-number
Number.NEGATIVE_INFINITY
Represents a negative infinity. It is the same as the
global variable -Infinity
Number.POSITIVE_INFINITY
Represents a positive infinity. It is the same as the
global variable Infinity
toString(radix)
Converts the Number into the specified radix . If radix
is not specified, 10 is used. The radix must be a number
between 2 and 36, both inclusive
toLocaleString()
Formats the number into a local specific format and
returns it as a primitive string value. Currently, it
returns the same value as the toString() method
valueOf()
Returns the primitive value stored in the Number object
toFixed(digits)
Returns a string representation of the number that
contains exactly the specified digits after the decimal
point. The number is rounded if necessary. The
number is zero-padded if the digits after the decimal
is less than the specified digits . If the number is
greater than 1e+21, it will return a string representing
the number in exponential notation. If digits is not
specified, zero is assumed. The digits can be between
0 and 20
toExponential(digits)
Returns a string representation of the number in
exponential notation. Contains one digit before the
decimal and digits number of digits after the decimal.
The digits can be between 0 and 20
toPrecision(precision)
Returns a string representation of the number with
precision significant digits. It may return the number
in decimal or exponential notation. If precision is not
specified, it converts the number to a string and returns
the result
 
 
Search WWH ::




Custom Search