MathUtil
Script will run the provided mathematical action on 2 provided values and produce a result. The result can be stored on the context using the contextKey argument
javascript · Common Scripts
Details
| ID | MathUtil |
|---|---|
| Language | javascript |
| From Version | 5.0.0 |
| Tags | Utility |
README
Runs the provided mathematical action on 2 provided values and produce a result.
The result can be stored on the context using the contextKey argument.
Script Data
| Name | Description |
|---|---|
| Script Type | javascript |
| Tags | Utility |
Inputs
| Argument Name | Description |
|---|---|
| lh | The left hand parameter. |
| rh | The right hand parameter. |
| action | The math expression (+, -, >, <, ==, *, /, %). |
| rhRegex | The regex used to filter only a specific part of the right hand argument. |
| lhRegex | The regex used to filter only a specific part of the left hand argument. |
| lhRadix | The radix for the left hand value. The default is 10. |
| rhRadix | Radix for right hand value, defaults to 10 |
| contextKey | The path to store the result. |
Outputs
| Path | Description | Type |
|---|---|---|
| MathResult | The result of the math action. This might be overriden by contextKey. |
Unknown |
commonfields: id: MathUtil version: -1 name: MathUtil script: '' type: javascript tags: - Utility comment: | Script will run the provided mathematical action on 2 provided values and produce a result. The result can be stored on the context using the contextKey argument enabled: true args: - name: lh required: true default: true description: Left hand parameter. - name: rh required: true description: Right hand parameter. - name: action required: true description: Math expression (+, -, >, <, ==, *, /, %). - name: rhRegex description: Regex to filter only a specific part of the right hand argument. - name: lhRegex description: Regex to filter only a specific part of the left hand argument. - name: lhRadix description: Radix for left hand value, defaults to 10. - name: rhRadix description: Radix for right hand value, defaults to 10. - name: contextKey description: Path where to store result. outputs: - contextPath: MathResult description: The result of the *last* math action. Might be overriden by contextKey. scripttarget: 0 dependson: {} timeout: 0s fromversion: 5.0.0 tests: - No tests (auto formatted)