Did you read the API doc for the printf method? It has a link to Format String syntax that explains how to use it.
Also do a Search on the forum for printf to find some code examples.
Then write...