The following works great:

int x = 123
String.format(" %1$013d", x);

See http://docs.oracle.com/javase/7/docs...Formatter.html for more complete information.