Skip to main content

RoundTask

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
}
}

See the RoundTask typescript definition in @switchboard-xyz/common

Fields

NameTypeDescription
 method

The rounding method to use.

 decimals

int32

The number of decimals to round to.

Enums

 Method

ValueNameDescription
 0METHOD_ROUND_UP

Round the result down.

 1METHOD_ROUND_DOWN

Round the result up.