gn:act_calculate
- Description
- Action used to perform calculation operations on different actors and stores result in target.
- If calculations with trigonometric functions give the wrong results, please note that the trigonometric variables input is expressed in radians, not degrees
- By default, the format of calculation result on
GnEditText
is set to0.00
.
- If the result needs to be formatted differently, check attribute
gn:s_decimalFormat
onGnEditText
- Action returns
- void
Action signatures
Calculate result into target widget
[gn:act_calculate]|[target,calculationFormula]
Parameter Description target
target from where the while action is using value as expression parameter - Valid targets:
calculationFormula
represents formula to be calculated - WidgetId’s, String resources or ginstr app variables can be used to replace variable placeholders in the equation,
- i.e.
3*sin(@+id/widgetId)-2(@+variable/varId-2)
.
- i.e.
- All values in actors should be numeric or they will be ignored in calculation
- Actors that can be used as calculation variables:
- string resources
Example
@variable/myResultVar
- target where the calculation result will be stored@+id/widgetOne*@variable/calcVarOne
- calculation formula
- ⤷
[gn:act_calculate]|[@variable/myResultVar,@+id/widgetOne*@variable/calcVarOne]
- ⤷