public static String zeroPad(long number, int width) {
long wrapAt = (long)Math.pow(10, width);
return String.valueOf(number % wrapAt + wrapAt).substring(1);
}
The only problem with this approach is that it makes you put on your thinking hat to figure out how it works.