A fairly dirty but pragmatic approach would be to make a call on what's the highest number you ever expect to see in attribute
, then use
substring("****...", 1, $repeat)
where you have as many *
s in that string as that maximum number you expect. But I hope that there's something better!