token:Calculate
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| token:Calculate [2015/07/15 10:26] – peternlewis | token:Calculate [2023/11/10 03:29] (current) – peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | The //%Calculate%1+2%// token returns the result of performing a calculation. | + | ===== Calculate |
| - | This allows you to include | + | The // |
| + | where // | ||
| + | * Mathematical formula like `(2 + 3)*12` | ||
| + | * Use any [[token: | ||
| + | * :!: Just enter the Variable Name (without the `%`) in the Calculate token **`< | ||
| + | * Examples: | ||
| + | * `%Calculate%MyVar + 1%` | ||
| + | * `%Calculate%(MyVarWordsPerSec * 60)/ | ||
| + | * Use any of the built-in Keyboard Maestro [functions](: | ||
| + | * Get the numeric value of an Variable array element, like `MyVar[2]`, if MyVar is `10, | ||
| - | Remember that within a calculation | + | The //%Hex2%// token (v8+) returns the value in Hex format, padded with zeros to two digits. |
| - | * [%Variable%Var%](Variable) | + | The //%Dec2%// token (v8+) returns the value in decimal format, padded with zeros to two digits (similarly //%Dec5%// to five digits, etc). |
| - | * %Calculate%Var% | + | |
| - | A notable different would be if the variable had a value like “1.230”. | + | The //%Oct3%// token (v8+) returns |
| + | |||
| + | The //%Bin8%// token (v8+) returns | ||
| + | |||
| + | **Example Action** | ||
| + | |||
| + | {{: | ||
| + | |||
| + | A reminder that the following are only equivalent if the [[token: | ||
| + | |||
| + | * %Variable%Count% (Variable) | ||
| + | * %Calculate%Count% (Number) | ||
| + | |||
| + | So, if MyVar is " | ||
| + | * %Variable%MyVar% will return `005` | ||
| + | * %Calculate%MyVar% will return `5` | ||
| + | |||
| + | ===== See Also ===== | ||
| + | |||
| + | ==== Actions ==== | ||
| + | |||
| + | * [[action: | ||
| + | * [[: | ||
| + | |||
| + | === Tokens === | ||
| + | |||
| + | * [[token: | ||
| + | * [[/ | ||
token/Calculate.1436956019.txt.gz · Last modified: by peternlewis
