TRational

A number type allowing for higher precision when used to represent a rational number with a specified denominator and additional fields indicating the change direction across different periods.

Extends

Constructors

  • constructor

    • new TRational(numerator: number, denominatorType: DenominatorType, doubleValue: number, tick: Trend, trendOnDay: Trend, trendOnPrevious: Trend): TRational

      Represents a number that can be expressed in the form numerator / denominator, with additional fields indicating the change direction across different periods. Supports a fixed set of denominator values.

      Parameters

      • numerator: numberthe numerator of the rational number.
      • denominatorType: DenominatorTypethe denominator type of the rational number.
      • doubleValue: numberthe closest JavaScript number. If not supplied an approximation is calculated.
      • tick: Trendtrend direction since the previous disseminated value for the field that was different than the current value.
      • trendOnDay: Trendtrend direction since the previous day's value for the field.
      • trendOnPrevious: Trendtrend direction since the previous disseminated value for the field.

      Returns TRational

Methods

  • fromJSON

  • trendToString

    • trendToString(trend: Trend): string

      Utility to convert trend into a friendly single-character representation.

      Returns string

  • toString

    • toString(): string

      Format a string showing the value and trending information.

      Returns string

  • toJSON

    • toJSON(): any

      Returns any

  • trendingToString

    • trendingToString(): string

      Format a string showing trending information.

      Returns string

  • valueOf

    • valueOf(): number

      Returns the doubleValue.

      Returns number

Properties

Also in this Section