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
maybe it's too late but putting it here for others
int width = 5; int precision = 2; float f = 12.34567f; System.out.printf("%"+width+"."+precision+"f%n",f);
tested in java 1.8