OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

org.ecmascript.primitive
Class Number

org.ecmascript.object.Object
   |
   +--org.ecmascript.primitive.Number

public class Number
extends Object
The native browser JavaScript object used to wrap primitive numeric values.

Note that this object is implemented and supported by the web browser and results of its use may vary.



Field Summary

public Number
MAX_VALUE
The largest possible value in JavaScript.
public Number
MIN_VALUE
The smallest possible value in JavaScript.
public Number
NaN
An identifier for values that are not numbers.
public Number
NEGATIVE_INFINITY
An identifier for values that are less than MIN_VALUE.
public Number
POSITIVE_INFINITY
An identifier for values that are greater than MAX_VALUE.


Fields inherited from org.ecmascript.object.Object

constructor, prototype


Constructor Summary

public
Number(Number value)
The native browser JavaScript object used to wrap primitive numeric values.


Method Summary

public String
toExponential(Number numberOfDecimalPlaces)
Creates a String representation of the number in exponential notation using the specified number of decimal places.
public String
toFixed(Number numberOfDecimalPlaces)
Creates a String representation of the number that is rounded to the specified number of decimal places.
public String
toPrecision(Number numberOfDigits)
Creates a String representation of the number that uses only the specified number of digits.
public String
toString(Number radix)
Creates a String representation of the number using the specified radix.


Field Detail


MAX_VALUE

public Number MAX_VALUE

The largest possible value in JavaScript.

MIN_VALUE

public Number MIN_VALUE

The smallest possible value in JavaScript.

NaN

public Number NaN

An identifier for values that are not numbers. For example, NaN would result from someone trying to parse a String that cannot be converted into a Number.

Notice the subtlety with Number.NaN, Global.NaN, and Global.isNaN():
  • NaN == Number.NaN has a result of false.
  • NaN === Number.NaN has a result of false.
  • NaN == NaN has a result of false.
  • NaN === NaN has a result of false.
  • Number.NaN == Number.NaN has a result of false.
  • Number.NaN === Number.NaN has a result of false.
  • isNaN(NaN) has a result of true.
  • isNaN(Number.NaN) has a result of true.
See also:
Global.isNaN(String)
Global.NaN

NEGATIVE_INFINITY

public Number NEGATIVE_INFINITY

An identifier for values that are less than MIN_VALUE.

POSITIVE_INFINITY

public Number POSITIVE_INFINITY

An identifier for values that are greater than MAX_VALUE.
See also:
Global.Infinity

Constructor Detail


Number

public Number(Number value)

The native browser JavaScript object used to wrap primitive numeric values.

Note that this object is implemented and supported by the web browser and results of its use may vary.

Parameters:
value  -  the numeric value to convert into a number; if conversion fails, Number.NaN will be used instead

Method Detail


toExponential

public String toExponential(Number numberOfDecimalPlaces)

Creates a String representation of the number in exponential notation using the specified number of decimal places.

Parameters:
numberOfDecimalPlaces  -  the number of decimal places to use
Return:
String - a String representation of the number in exponential notation using the specified number of decimal places

toFixed

public String toFixed(Number numberOfDecimalPlaces)

Creates a String representation of the number that is rounded to the specified number of decimal places.

Parameters:
numberOfDecimalPlaces  -  the number of decimal places to use
Return:
String - a String representation of the number in rounded to the specified number of decimal places

toPrecision

public String toPrecision(Number numberOfDigits)

Creates a String representation of the number that uses only the specified number of digits.

Parameters:
numberOfDigits  -  the number of digits to use
Return:
String - a String representation of the number that uses only the specified number of digits

toString

public String toString(Number radix)

Creates a String representation of the number using the specified radix.

Parameters:
radix  -  optional base radix used to represent the number, e.g. 2 for binary, 8 for octal, 10 for decimal, and 16 for hexadecimal
Default value = 10
Return:
String - a String representation of the number using the specified radix

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2011.04.27 02:28 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.