Here you can find the source of zeroPad(int value, int padding)
private static String zeroPad(int value, int padding)
//package com.java2s; public class Main { private static String zeroPad(int value, int padding) { StringBuilder b = new StringBuilder(); b.append(value);/*ww w. j a va 2 s.com*/ while (b.length() < padding) { b.insert(0, "0"); } return b.toString(); } }