Skip to content

Math ​

Calculations, measurements, and unit conversion.

import Math;

calculate ​

Performs a number operation on the input and returns the result.

calculate(number: Number, operation: Enum, scientificOperation: Enum, WFMathOperand: Number, WFScientificMathOperand: Number) -> Number
ParameterTypeDefault
numberNumber—
operation+ | - | × | ÷ | …"+"
scientificOperationModulus | x^2 | x^3 | x^y | e^x | 10^x | ln(x) | log(x) | √x | ∛x | x! | sin(x) | cos(x) | tan(x) | abs(x)—
WFMathOperandNumber—
WFScientificMathOperandNumber—

Shortcuts action: is.workflow.actions.math

calculateExpression ​

Evaluates the mathematical expression in the given input text and outputs the result as a number.

Example expressions:

7 + 7

8 * sqrt(5)

$8 USD in euros

7 feet in meters

calculateExpression(input: Text) -> Number
ParameterTypeDefault
inputText—

Shortcuts action: is.workflow.actions.calculateexpression

calculateStatistics ​

Calculates statistics on the numbers that are provided as input.

calculateStatistics(operation: Enum, input: Number) -> Number
ParameterTypeDefault
operationAverage | Minimum | Maximum | Sum | Median | Mode | Range | Standard Deviation"Average"
inputNumber—

Shortcuts action: is.workflow.actions.statistics

convertMeasurement ​

Converts the measurements passed into the action to the specified unit.

convertMeasurement(type: Text, unit: Text, measurement: Number) -> Number
ParameterTypeDefault
typeText"Length"
unitText—
measurementNumber—

Shortcuts action: is.workflow.actions.measurement.convert

measurement ​

Passes the specified measurement (including number and unit) to the next action.

measurement(type: Text, value: Number) -> Number
ParameterTypeDefault
typeText"Length"
valueNumber—

Shortcuts action: is.workflow.actions.measurement.create

number ​

Passes a number to the next action.

number(number: Number) -> Number
ParameterTypeDefault
numberNumber—

Shortcuts action: is.workflow.actions.number

randomNumber ​

Passes a random number between the given minimum and maximum to the next action. The minimum and maximum numbers are included as possible results.

randomNumber(minimum: Number, maximum: Number) -> Number
ParameterTypeDefault
minimumNumber—
maximumNumber—

Shortcuts action: is.workflow.actions.number.random

roundNumber ​

Rounds the number(s) passed into the action.

roundNumber(number: Number, value: Enum, mode: Enum, tenToThePowerOf: Number) -> Number
ParameterTypeDefault
numberNumber—
valueMillions | Hundred Thousands | Ten Thousands | Thousands | Hundreds Place | Tens Place | Ones Place | Tenths | Hundredths | Thousandths | Ten Thousandths | Hundred Thousandths | Millionths | Ten Millionths | Hundred Millionths | Billionths | 10 ^"Ones Place"
modeNormal | Always Round Up | Always Round Down"Normal"
tenToThePowerOfNumber0

Shortcuts action: is.workflow.actions.round