I\'m just trying to convert some C code over to Java and I\'m having a little trouble with String.printf.
String.printf
In C, to get a specific width based on a varia
Declare an extra variable before using printf:
printf
String format = "%" + fieldSize + "d"; System.out.printf(format, yourVariables);
(this is the first solution I found from a web search)