protected static String formatMDLInt ( int x , int n ) { char [ ] buf = new char [ n ] ; Arrays . fill ( buf , ' ' ) ; String val = Integer . toString ( x ) ; if ( val . length ( ) > n ) val = "0" ; int off = n - val . length ( ) ; for ( int i = 0 ; i < val . length ( ) ; i ++ ) buf [ off + i ] = val . charAt ( i ) ; return new String ( buf ) ; }
Formats an integer to fit into the connection table and changes it to a String .