How to format a number 0..9 to display with 2 digits (it’s NOT a date)

You can use:

String.format("%02d", myNumber)

See also the javadocs

Leave a Comment