Is there a neater way for getting the number of digits in an int than this method?
int numDigits = String.valueOf(1000).length();
The logarithm is your friend:
int n = 1000; int length = (int)(Math.log10(n)+1);
NB: only valid for n > 0.