I have an int variable and I want to determine its length (i.e. I want the int to be of 4 characters).

I understand how to determine the length of a String, i.e.


String text
int temptext = text.length();


Can this be done similar with an int variable or would I have to convert the int to a String (and then determine its length) and then back to an int?

Thanks for any advice :-)