KeyRoutines
StepFreemath.calculate

Calculate numbers and percentages inside a Windows routine

Calculate works out a formula you type, like a price times 1.2 or a volume minus 10. Values from other steps go straight into the formula, so you can do real maths without a separate tool.

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

SettingWhat it does
FormulaThe 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.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.