Math Actions

Table of contents

  1. Calculate
  2. Statistic
  3. Rounding
    1. Round
    2. Round Down
    3. Round Up

To use actions in this category, use this include statement:

#include 'actions/math'

Calculate

Perform various calculation operations using one or two operands.

enum calculationOperation {
    'x^2',
    'х^3',
    'x^у',
    'e^x',
    '10^x',
    'In(x)',
    'log(x)',
    '√x',
    '∛x',
    'x!',
    'sin(x)',
    'cos(X)',
    'tan(x)',
    'abs(x)',
}

calculate(calculationOperation operation, number operandOne, number ?operandTwo): number

Statistic

Perform a statistical operation on input.

enum statisticOperations {
    'Average',
    'Minimum',
    'Maximum',
    'Sum',
    'Median',
    'Mode',
    'Range',
    'Standard Deviation',
}

statistic(statisticOperations operation, variable input)

Rounding

Round

Rounds number to specified rounding place.

enum rounding {
    'Ones Place',
    'Tens Place',
    'Hundreds Place',
    'Thousands',
    'Ten Thousands',
    'Hundred Thousands',
    'Millions',
}

round(number number, rounding ?roundTo = "Ones Place")

Round Down

Always round a number down to a specified rounding place.

enum rounding {
    'Ones Place',
    'Tens Place',
    'Hundreds Place',
    'Thousands',
    'Ten Thousands',
    'Hundred Thousands',
    'Millions',
}

floor(number number, rounding ?roundTo = "Ones Place")

Round Up

Always round a number up to a specified rounding place.

enum rounding {
    'Ones Place',
    'Tens Place',
    'Hundreds Place',
    'Thousands',
    'Ten Thousands',
    'Hundred Thousands',
    'Millions',
}

ceil(number number, rounding ?roundTo = "Ones Place")

Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.