Have you tried using the exact same code?
This is a subtle point, but when the JavaDocs for Formatter talk about "integer" or "integral" types, they don't just mean int. The term actually includes byte, short, int, long, all the wrapper classes for those primitive types, and BigInteger. In short, all standard numeric data types in
Java except those for floating-point numbers. So 'd' can be applied to all of these.