I just came across the need to calculate the digits of a number. It sounds trivial as we can see the digits & count them easily. Me encontré con la necesidad de calcular los dígitos de un número. Suena trivial como podemos ver los dígitos y contar con ellos fácilmente.
The challenge is how to find them (with least effort) computationally? El reto es encontrar la manera de ellos (con menos esfuerzo) computacionalmente?

Solution: Solución:

1 + (int) (Math.log(i) / base10) 1 + (int) (Math.log (i) / base10)

where base10 = Math.log(10) donde base10 = Math.log (10)