"IllegalFormatConversionException: d != java.lang.String" when padding number with 0s?
You don't need the Integer.toString()
:
newPK = String.format("%08d", lastRecord);
String.format()
will do the conversion and the padding.
You don't need the Integer.toString()
:
newPK = String.format("%08d", lastRecord);
String.format()
will do the conversion and the padding.