Here you can find the source of align(int i)
private static String align(int i)
//package com.java2s; //License from project: Open Source License public class Main { private static String align(int i) { String s = String.valueOf(i); if (s.length() == 0) { return "00" + s; }//from w w w.j av a 2s .co m if (s.length() == 1) { return "0" + s; } return s; } }