6.7 Adding a string decider
Whenever the XML allows a string decider (instead of a concrete string), these are the valid options:
- A binary operation using the binary-operation attribute. Specify this attribute inside a <calculate> element.
- Other supported operations (that are not binary) using the operation attribute. Specify this attribute inside a <calculate> element.
- A concrete string value consisting of any text inside the parent element.
To add a string decider
- Locate the UI component that holds a string (such as a text box or select box). Determine which operation to use.
- Configure a binary operation.
- Set the <calculate> element with the binary-operation attribute set to "substring".
- Set the <first> element to a string decider and the <second> element to an integer.
<calculate binary-operation="substring">
<first>
<component id="payment-value" />
</first>
<second>3</second>
</calculate>
- Configure another operation.
- Set the <calculate> element with the binary-operation attribute set to one of the following:
- "int-to-string" – Evaluates the integer and takes the string value. Requires a child integer decider.
- "double-to-string" – Evaluates a double decider and takes the string value. It requires a double decider. Optionally, you can use the precision attribute to specify how many decimal places to use in the result.
- (Optional) Use any of the following keywords to get specific strings:
- "empty-string" – Returns an empty string
- "space" – Returns a space
Related topics