The second option is clearly much easier and it amazes me that every language doesn't implement the sprintf-function as a standard function There are probably a tonne of these implementations out ...