LongPort OpenAPI SDK

    Class Decimal

    Index

    Constructors

    • Parameters

      • value: string | number

      Returns Decimal

    Methods

    • Parameters

      • num: number
      • scale: number

      Returns Decimal

    • Returns string

    • Returns number

    • Returns the smallest integer greater than or equal to a number.

      Returns Decimal

    • Returns the largest integer less than or equal to a number.

      Returns Decimal

    • Returns a new Decimal representing the fractional portion of the number.

      Returns Decimal

    • Returns true if the decimal is negative.

      Returns boolean

    • Returns true if the decimal is positive.

      Returns boolean

    • Returns true if this Decimal number is equivalent to zero.

      Returns boolean

    • Strips any trailing zero’s from a Decimal and converts -0 to 0.

      Returns Decimal

    • Returns a new Decimal number with no fractional portion (i.e. an integer). Rounding currently follows “Bankers Rounding” rules. e.g. 6.5 -> 6, 7.5 -> 8

      Returns Decimal

    • Returns a new Decimal number with the specified number of decimal points for fractional portion. Rounding currently follows “Bankers Rounding” rules. e.g. 6.5 -> 6, 7.5 -> 8

      Parameters

      • dp: number

      Returns Decimal

    • Returns a new Decimal integral with no fractional portion. This is a true truncation whereby no rounding is performed.

      Returns Decimal

    • Returns true if the value of this Decimal is greater than the value of x, otherwise returns false.

      Parameters

      Returns boolean

    • Returns true if the value of this Decimal is greater than or equal to the value of x, otherwise returns false.

      Parameters

      Returns boolean

    • Returns true if the value of this Decimal equals the value of x, otherwise returns false.

      Parameters

      Returns boolean

    • Returns true if the value of this Decimal is less than the value of x, otherwise returns false.

      Parameters

      Returns boolean

    • Returns true if the value of this Decimal is less than or equal to the value of x, otherwise returns false.

      Parameters

      Returns boolean

    • Compares the values of two Decimals.

      Returns -1 if the value of this Decimal is less than the value of x.

      Returns 1 if the value of this Decimal is greater than the value of x.

      Returns 0 if the value of this Decimal equals the value of x.

      Parameters

      Returns number

    • Computes the sine of a number (in radians)

      Returns Decimal

    • Computes the cosine of a number (in radians)

      Returns Decimal

    • Computes the tangent of a number (in radians). Panics upon overflow or upon approaching a limit.

      Returns Decimal

    • The square root of a Decimal. Uses a standard Babylonian method.

      Returns Decimal

    • Raise self to the given Decimal exponent: xy. If exp is not whole then the approximation ey*ln(x) is used.

      Parameters

      Returns Decimal

    • Calculates the natural logarithm for a Decimal calculated using Taylor’s series.

      Returns Decimal

    • Calculates the base 10 logarithm of a specified Decimal number.

      Returns Decimal

    • The estimated exponential function, ex. Stops calculating when it is within tolerance of roughly 0.0000002.

      Returns Decimal

    • The estimated exponential function, ex using the tolerance provided as a hint as to when to stop calculating. A larger tolerance will cause the number to stop calculating sooner at the potential cost of a slightly less accurate result.

      Parameters

      Returns Decimal

    • The Cumulative distribution function for a Normal distribution

      Returns Decimal

    • The Probability density function for a Normal distribution.

      Returns Decimal

    • Returns any

    MMNEPVFCICPMFPCPTTAAATR