public static String formatNumber (int num, String formatAs) { DecimalFormat df = new DecimalFormat (formatAs); String str2 = df.format (num); return str2; }