User Tools

Site Tools


action:Set_Variable_to_Calculation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
action:Set_Variable_to_Calculation [2017/09/11 21:53]
peternlewis [Example 2]
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 46: Line 52:
  
 ===== 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 ====
action/Set_Variable_to_Calculation.1505181182.txt.gz · Last modified: 2017/09/11 21:53 by peternlewis