“IllegalFormatConversionException: d != java.lang.String” when padding number with 0s?
问题 I had a perfectly working code yesterday, in the exact form of: int lastRecord = 1; String key = String.format("%08d", Integer.toString(lastRecord)); Which would pad it nicely to 00000001. Now I kicked it up a notch with twoKeyChar getting a string from a table and lastRecord getting an int from a table. As you can see the concept is essentially the same - I convert an int to a string and try to pad it with 0s; however, this time I get the following error: java.util