How it works
- Type a formula with + - * / %, brackets and functions such as round, min, max, abs, sqrt or pow.
- Put values from earlier steps or variables into it with tokens.
- A result that isn't a number fails the step, and dividing by zero is reported as such.
- The formula can't read saved secrets.
Routines that use it
Volume step
Take the current level, subtract 10 with max to stay above 0, and apply it with Set volume.
Loop counter
Add 1 to a counter each round and store it with Set variable.
Percent done
Divide items done by the total from Count list items and show it with Show progress.
Settings
| Setting | What it does |
|---|---|
| Formula | The sum to work out, with + - * / % and brackets, and functions such as round, min, max, abs or sqrt. Put values from other steps in with tokens. |
Good to know
- Only numbers: text maths isn't supported here.
- Saved secrets can't be used in a formula.
Questions
- Can KeyRoutines do maths?
- Yes. The Calculate step works out formulas with the usual operators, brackets and functions like round and sqrt.
- How do I use a value from another step in a formula?
- Insert it as a token where the number would go; the step fills it in before calculating.