3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by stevanity
1

Generally it's the number between the percent sign ('%') and the letter. ...much as you would see in the C 'printf' function.

StringBuilder sb = new StringBuilder();
		Formatter formatter = new Formatter(sb, Locale.US);
		formatter.format("/%10d/", 23421);
		System.out.println(sb.toString());

Produces this output: / 23421/

1

Or you could directly use C style printf method.

System.out.printf("|%10d|",23421);
Votes + Comments
Good answer.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.