Here you can find the source of zeroFill(int iv, int len)
public static String zeroFill(int iv, int len)
//package com.java2s; //License from project: Open Source License public class Main { public static String zeroFill(int iv, int len) { String v = String.valueOf(iv); if (v.length() < len) { StringBuilder bd = new StringBuilder(v); for (int i = 0; i < len - v.length(); i++) { bd.insert(0, '0'); }/*from w w w .j a va 2 s . co m*/ return bd.toString(); } else { return v; } } }