Set your number picker to show leading zeros by applying a formatter to it.
Example is using an anonymous instance, but of course it doesn’t have to.
myNumberPicker.setFormatter(new NumberPicker.Formatter() { @Override public String format(int value) { return String.format("%02d", value); } });
For %02d this goes:
- 0 for filling with zeros
- 2 for length of 2
Many thanks, I’ve been struggling with how to do this for the last day.
Cheers.
Great to hear that it came to use!
Thanks for the tip!