Is there a neater way for getting the number of digits in an int than this method?
int numDigits = String.valueOf(1000).length();
Another string approach. Short and sweet - for any integer n.
n
int length = ("" + n).length();