This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
action:Set_Variable_to_Calculation [2017/03/05 22:19] peternlewis [Forum] |
action:Set_Variable_to_Calculation [2023/11/10 22:40] (current) peternlewis [Formatting] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{:action:calculator-icon.png?nolink|}} | ||
====== Set Variable to Calculation Action ====== | ====== Set Variable to Calculation Action ====== | ||
Line 28: | Line 27: | ||
As can be seen by the blue shade of the action gear menu there is an additional option for the action, specifically you can //Format the Result// using [[https://www.stairways.com/action/linkthru?unicodenumberformat|Unicode Number Format Patterns]] such as //#,##0.##//. | As can be seen by the blue shade of the action gear menu there is an additional option for the action, specifically you can //Format the Result// using [[https://www.stairways.com/action/linkthru?unicodenumberformat|Unicode Number Format Patterns]] such as //#,##0.##//. | ||
+ | |||
+ | (i) Note that numeric values in Keyboard Maestro allow only “full stop” decimal (.) and no thousand separators (except optional underscores), so the output of this action with formatting will likely not be a valid number for a Keyboard Maestro calculation in many locales. **It should be used only for display purposes.** | ||
+ | |||
===== Result ===== | ===== Result ===== | ||
- | At the bottom of the action you can see the current value of the calculation. If the calculation is invalidly formatted, the invalid part of the calculation will show up in red. If the calculation would currently fail because an input variable does not currently have a numeric value, that variable will show up in orange. | + | At the bottom of the action you can see the current value of the calculation. |
+ | |||
+ | If the calculation is invalidly formatted, the invalid part of the calculation will show up in <color #ed1c24>RED</color>. | ||
+ | |||
+ | If the calculation would currently fail because an input variable does not currently have a numeric value, that variable will show up in <color #ff7f27>ORANGE</color>. | ||
===== Examples ===== | ===== Examples ===== | ||
Line 43: | Line 49: | ||
==== Example 2 ==== | ==== Example 2 ==== | ||
- | {{:action:vars-.x.y.width.height-[]-160828.jpg?nolink|}} | + | {{vars-x-y-width-height.png?597;nolink|}} |
===== See Also ===== | ===== See Also ===== | ||
- | |||
- | ---- | ||
==== Actions ==== | ==== Actions ==== | ||
Line 62: | Line 66: | ||
* [[function:TRUNC|TRUNC()]] | * [[function:TRUNC|TRUNC()]] | ||
* [[:Functions|See all Functions]] | * [[:Functions|See all Functions]] | ||
+ | |||
+ | ==== Tokens ==== | ||
+ | |||
+ | * [[token:Calculate|%Calculate%]] token | ||
+ | * [[token:CalculateFormat|%CalculateFormat%]] token | ||
+ | * [[:Tokens|See all Tokens]] | ||
==== Topics ==== | ==== Topics ==== | ||
Line 67: | Line 77: | ||
* [[:Text Fields|Text Fields]] | * [[:Text Fields|Text Fields]] | ||
* [[:Frequently Asked Questions|FAQ]] | * [[:Frequently Asked Questions|FAQ]] | ||
- | |||
- | ---- | ||
==== Forum ==== | ==== Forum ==== |