You can probably use sprintf.
Your code could be something like this:
string col_title = ""
discrete groups
matrix val = values(groups)
loop i = 1..rows(val) --quiet
sprintf myvar "%d", val[$i]
col_title += @myvar
col_title += " "
endloop
It's very clear now! Thank you Giuseppe and Allin for your help!
Best,
artur