private static String getLeadingZeros ( int i , int size ) { assert i <= size ; int w1 = ( int ) Math . floor ( Math . log10 ( size ) ) ; int w2 = ( int ) Math . floor ( Math . log10 ( i ) ) ; String s = "" ; for ( int j = w2 ; j < w1 ; j ++ ) { s += "0" ; } return s ; }
Prepares an int for printing with leading zeros for the given size .