Round the current running result to a set number of decimal places.

Input: The current running numerical result.

Returns: The running result rounded to a set number of decimal places.

Example: Round down the running resul to 8 decimal places

{ "roundTask": { "method": "METHOD_ROUND_DOWN", "decimals": 8 } }

Implements

Constructors

  • Constructs a new RoundTask.

    Parameters

    Returns RoundTask

Properties

decimals: number

The number of decimals to round to.

The rounding method to use.

Methods

  • Converts this RoundTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

    • [k: string]: any
  • Creates a new RoundTask instance using the specified properties.

    Parameters

    Returns RoundTask

    RoundTask instance

  • Decodes a RoundTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    • Optional length: number

      Message length if known beforehand

    Returns RoundTask

    RoundTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Decodes a RoundTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns RoundTask

    RoundTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Encodes the specified RoundTask message. Does not implicitly verify messages.

    Parameters

    • message: IRoundTask

      RoundTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified RoundTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IRoundTask

      RoundTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a RoundTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: {
          [k: string]: any;
      }

      Plain object

      • [k: string]: any

    Returns RoundTask

    RoundTask

  • Gets the default type url for RoundTask

    Parameters

    • Optional typeUrlPrefix: string

      your custom typeUrlPrefix(default "type.googleapis.com")

    Returns string

    The default type url

  • Creates a plain object from a RoundTask message. Also converts values to other types if specified.

    Parameters

    • message: RoundTask

      RoundTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a RoundTask message.

    Parameters

    • message: {
          [k: string]: any;
      }

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not

Generated using TypeDoc