You can use:
String.valueOf(number).length();