Format message with Integer fillers
import java.text.MessageFormat;
public class Main {
public static void main(String[] argv) throws Exception {
Object[] params = new Object[] { new Integer(123), new Integer(1234) };
String msg = MessageFormat.format("{0,number} a''s and {1,number} b''s", params);
System.out.println(msg);
}
}
//123 a's and 1,234 b's
Related examples in the same category