Is there a neater way for getting the number of digits in an int than this method?
int numDigits = String.valueOf(1000).length();
One wants to do this mostly because he/she wants to "present" it, which mostly mean it finally needs to be "toString-ed" (or transformed in another way) explicitly or implicitly anyway; before it can be presented (printed for example).
If that is the case then just try to make the necessary "toString" explicit and count the bits.