JavaScript API for Oracle type NUMBER. Since Oracle 23.5, this class also supports infix operator arithmetics: +, -, /, *, etc.

Hierarchy

  • OracleNumberOperators
    • OracleNumber

Constructors

  • Construct an OracleNumber from a JavaScript number or a string.

    Parameters

    • n: string | number

    Returns OracleNumber

Properties

e: OracleNumber = ...

The e constant.

ln10: OracleNumber = ...

The ln10 constant.

pi: OracleNumber = ...

The pi constant.

zero: OracleNumber = ...

The zero constant.

Methods

  • Computes the absolute value of the Oracle number

    Returns

    the absolute value of the Oracle number

    Returns OracleNumber

  • Adds an Oracle number to another Oracle number

    Returns

    returns the sum of the two Oracle NUMBERs

    Note: since Oracle 23.5, this + other can be used instead.

    Parameters

    Returns OracleNumber

  • Computes the arc cosine in radians of the Oracle number

    Returns

    the arc cosine in radians of the Oracle number

    Returns OracleNumber

  • Computes the arc sine in radians of the Oracle number

    Returns

    the arc sine in radians of the Oracle number

    Returns OracleNumber

  • Computes the arc tangent in radians of the Oracle number

    Returns

    the arc tangent in radians of the Oracle number

    Returns OracleNumber

  • Returns any

  • Computes the ceiling of the Oracle number

    Returns

    the ceiling of the Oracle number

    Returns OracleNumber

  • Compares two Oracle numbers. Returns -1 if this < other, 0 if they are equal, and 1 if this > other.

    Returns

    the result of the comparison as a number between -1 and +1.

    Note: since Oracle 23.5, <, <=, >=, > can be used instead.

    Parameters

    Returns number

  • Checks if the Oracle number is equal to another Oracle number

    Returns

    true if both Oracle numbers are equal, otherwise false

    Note: since Oracle 23.5, == or != can be used instead.

    Parameters

    Returns boolean

  • Raises e to the power of this Oracle number

    Returns

    the result of the exponentiation as Oracle number

    Returns OracleNumber

  • Computes the floor of the number

    Returns

    the floor value of the Oracle number

    Returns OracleNumber

  • Computes the hyperbolic cosine of the Oracle number

    Returns

    the hyperbolic cosine of the Oracle number

    Returns OracleNumber

  • Computes the hyperbolic sine of the Oracle number

    Returns

    the hyperbolic sine of the Oracle number

    Returns OracleNumber

  • Computes the hyperbolic tangent of the Oracle number

    Returns

    the hyperbolic tangent of the Oracle number

    Returns OracleNumber

  • Tests if the number is an integer

    Returns

    true if the Oracle number is an integer, otherwise false

    Returns boolean

  • Returns boolean

  • Tests if the number is zero

    Returns

    true if the Oracle number is zero, otherwise false

    Returns boolean

  • Computes the natural logarithm of the Oracle number

    Returns

    the natural logarithm of the Oracle number

    Returns OracleNumber

  • Computes the modulus of two Oracle numbers.

    Returns

    this number modulo the other number

    Note: since Oracle 23.5, this % other can be used instead.

    Parameters

    Returns OracleNumber

  • Multiplies the Oracle number with another Oracle number

    Returns

    the result of the multiplication as Oracle number

    Note: since Oracle 23.5, this * other can be used instead.

    Parameters

    Returns OracleNumber

  • Negates the number

    Returns

    the negated Oracle number

    Note: since Oracle 23.5, -this can be used instead.

    Returns OracleNumber

  • Raises this Oracle number to the given exponent

    Returns

    the result of the exponentiation

    Note: since Oracle 23.5, this ** other can be used instead.

    Parameters

    Returns OracleNumber

  • Scales the digits to the left and right of the decimal point.

    Returns

    a new scaled Oracle number scaled according to the arguments

    Throws

    throws an exception if the number of left-hand-side digits is exceeded

    Parameters

    • left: number

      maximum number of decimal digits to the left of the decimal point. It will not effect the number, but throw an exception if this value is exceeded.

    • right: number

      maximum number of decimal digits to the right of the decimal point. The number is rounded at this point. Negative values are allowed.

    Returns OracleNumber

  • Shifts the number by the specified number of decimal places

    Returns

    an Oracle number containing the shifted result

    Note: since Oracle 23.5, this >> other or this << -other can be used instead.

    Parameters

    • digits: number | OracleNumber

      number of decimal places to shift. It can be negative. Positive values shift the decimal place to the right and negative values to the left. For example, if NUMBER corresponds to 1234.5 and digits == -1, the new NUMBER object will correspond to 123.45.

    Returns OracleNumber

  • Returns -1 if the sign of the number is negative, 0 if the number is 0, and > 0 if the number is positive.

    Returns

    a number indicating the sign of the Oracle number

    Returns number

  • Computes the square root of the Oracle number

    Returns

    the square root of the Oracle number

    Returns OracleNumber

  • Subtracts an Oracle number from the Oracle number and returns the resulting Oracle number

    Returns

    the result of the subtraction as OracleNumber

    Note: since Oracle 23.5, this - other can be used instead.

    Parameters

    • other: OracleNumber

      the other number to be subtracted from the OracleNumber

    Returns OracleNumber

  • Computes the tangent of the Oracle number

    Returns

    the tangent of the Oracle number

    Returns OracleNumber

  • Converts an Oracle NUMBER to type number

    Returns

    the converted number

    Returns number

  • Converts an Oracle NUMBER to a string, with an optional number format and NLS parameters. If no format string and NLS parameters are provided, the default values for the session are used.

    Returns

    the converted string

    Parameters

    • Optional format: string

      optional number format

    • Optional nlsParam: string

      optional NLS parameters

    Returns string

  • Truncates the number to the specified number of decimal places.

    Returns

    a truncated Oracle number

    Parameters

    • decplace: number | OracleNumber

      Number of decimal digits to the right of the decimal point at which to truncate. Negative values are allowed.

    Returns OracleNumber

  • Construct an OracleNumber from a JavaScript number.

    Returns

    a new OracleNumber object

    Parameters

    • n: number

    Returns OracleNumber

  • Parse a string into an OracleNumber, with an optional number format and NLS parameters. If no format string and NLS parameters are provided, the default values for the session are used.

    Returns

    OracleNumber value from parsing the input string

    Parameters

    • s: string

      the number string

    • Optional format: string

      optional number format

    • Optional nlsParam: string

      optional NLS parameters

    Returns OracleNumber