get number of digits in an integer code example
Example 1: find number of digits in a number
floor(log10(n) + 1);
Example 2: java how to find length of int
int x = 1234;
int lengthOfInt = String.valueOf(x).length(); //convert integer to String
//and get length of the String