public static String fixedWidthIntegertoString(int n,int w){
  String s=Integer.toString(n);
  while (s.length() < w) {
    s=" " + s;
  }
  return s;
}

public static String fixedWidthIntegertoString ( int n , int w ) { String s = Integer . toString ( n ) ; while ( s . length ( ) < w ) { s = " " + s ; } return s ; }
format integer with iw .
