private static void append ( StringBuilder sb , int val , int width ) { String s = Integer . toString ( val ) ; for ( int i = s . length ( ) ; i < width ; i ++ ) sb . append ( ' ' ) ; sb . append ( s ) ; }
Append the given value to the string builder with leading zeros to result in the given minimum width .