Skip to content

How to apply arithmetic operations on variables defined in a template #2125

Closed Answered by forgedhallpass
hktalent asked this question in Q&A
Discussion options

You must be logged in to vote

By default variables defined, under the variables attribute are considered strings.

If you would like to transform a specific variable to a number, you can use the to_number DSL function.

variables:
  xxx: 22
...
  dsl:
    - print_debug(xxx+'a') # = 22a
    - print_debug(to_number(xxx)*2) # = 44

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hktalent
Comment options

Answer selected by forgedhallpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
2 participants
Converted from issue

This discussion was converted from issue #2120 on June 07, 2022 10:55.