/* * This class contains my own number-formatting routines. */ class MyNumberFormat { /* * Returns a string of length FLEN in which integer X is * right-justified by blanks if X has < FLEN digits; otherwise, * returns the string representation of X. */ public static String format(int x, int flen){ String s = Integer.toString(x); int nb = flen - s.length(); for (int i = 1; i <= nb; i++) s = " " + s; return(s); } // End of method format } // End of class MyNumberFormat