Hmm.. you are looking for an equivalent like the c function sprintf.

You are right, the DIG command is ideal to build the string. It may be more optimised if you hand code in asm

Jerson