MLE PL/SQL Types(mle-js-plsqltypes)
    Preparing search index...

    Class OracleNumber

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

    Hierarchy

    • OracleNumberOperators
      • OracleNumber

    Indexable

    • [key: string]: any
    Index

    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 OracleNumber

      the absolute value of the Oracle number

    • Adds an Oracle number to another Oracle number

      Parameters

      Returns OracleNumber

      returns the sum of the two Oracle NUMBERs

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

    • Computes the arc cosine in radians of the Oracle number

      Returns OracleNumber

      the arc cosine in radians of the Oracle number

    • Computes the arc sine in radians of the Oracle number

      Returns OracleNumber

      the arc sine in radians of the Oracle number

    • Computes the arc tangent in radians of the Oracle number

      Returns OracleNumber

      the arc tangent in radians of the Oracle number

    • Returns any

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

      Parameters

      Returns number

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

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

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

      Parameters

      Returns boolean

      true if both Oracle numbers are equal, otherwise false

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

    • Raises e to the power of this Oracle number

      Returns OracleNumber

      the result of the exponentiation as Oracle number

    • Computes the hyperbolic cosine of the Oracle number

      Returns OracleNumber

      the hyperbolic cosine of the Oracle number

    • Computes the hyperbolic sine of the Oracle number

      Returns OracleNumber

      the hyperbolic sine of the Oracle number

    • Computes the hyperbolic tangent of the Oracle number

      Returns OracleNumber

      the hyperbolic tangent of the Oracle number

    • Tests if the number is an integer

      Returns boolean

      true if the Oracle number is an integer, otherwise false

    • Returns boolean

    • Tests if the number is zero

      Returns boolean

      true if the Oracle number is zero, otherwise false

    • Computes the natural logarithm of the Oracle number

      Returns OracleNumber

      the natural logarithm of the Oracle number

    • Computes the modulus of two Oracle numbers.

      Parameters

      Returns OracleNumber

      this number modulo the other number

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

    • Multiplies the Oracle number with another Oracle number

      Parameters

      Returns OracleNumber

      the result of the multiplication as Oracle number

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

    • Negates the number

      Returns OracleNumber

      the negated Oracle number

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

    • Raises this Oracle number to the given exponent

      Parameters

      Returns OracleNumber

      the result of the exponentiation

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

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

      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

      a new scaled Oracle number scaled according to the arguments

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

    • Shifts the number by the specified number of decimal places

      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

      an Oracle number containing the shifted result

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

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

      Returns number

      a number indicating the sign of the Oracle number

    • Computes the square root of the Oracle number

      Returns OracleNumber

      the square root of the Oracle number

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

      Parameters

      • other: OracleNumber

        the other number to be subtracted from the OracleNumber

      Returns OracleNumber

      the result of the subtraction as OracleNumber

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

    • Converts an Oracle NUMBER to type number

      Returns number

      the converted 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.

      Parameters

      • Optionalformat: string

        optional number format

      • OptionalnlsParam: string

        optional NLS parameters

      Returns string

      the converted string

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

      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

      a truncated Oracle number

    • Construct an OracleNumber from a JavaScript number.

      Parameters

      • n: number

      Returns OracleNumber

      a new OracleNumber object

    • 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.

      Parameters

      • s: string

        the number string

      • Optionalformat: string

        optional number format

      • OptionalnlsParam: string

        optional NLS parameters

      Returns OracleNumber

      OracleNumber value from parsing the input string