I have a jenkins pipeline in groovy and i have the following variables
x=100
y=0.2 * ${x}
but this is not working and getting message "WorkflowScript: 60: Environment variable values can only be joined together with ‘+’s. @ "
I tried with
def y = 0.2 * ${x}
also
def y = 0.2 * "${x}"
No luck
i am getting value x from jenkins input and would like to have value Y 20% of X
cat eh.groovy
x = 100
y = 0.2 * x
// println y //uncomment if you want/need the result
groovy eh.groovy
20.0
#
#or
#
groovy -e 'x=100;y=0.2*x; println y'
20.0