Reply To: Concatenating variables and text

PennController for IBEX Forums Support Concatenating variables and text Reply To: Concatenating variables and text

#8400
mawilson
Participant

I’ve realized how to deal with my case; it’s actually pretty easy since JavaScript lets you use addition to concatenate variables of different types.


newVar('grandaveragepercent')
    .set(getVar('grandaverage'))
    .set(v => Math.round(v * 100) + '%.')

Then just display the text as before, minus the .after(newText('%.')).

(I’d still be curious how this would work if I had two text variables I wanted to concatenate, since IIRC the way variables work in PCIbex wouldn’t just let you do getVar('mytextvariable1') + getVar('mytextvariable2').)