public static String toPaddedNumber ( int value , int width ) { StringBuilder s = new StringBuilder ( "00000000" ) . append ( Integer . toString ( value ) ) ; return s . substring ( s . length ( ) - width ) ; }
Create the string representation of an integer and pad it to a particular width using leading zeroes .