If one prefers floors to ceilings:

For n to have k digits,

10^{k-1} ≤ n < 10^k

k-1 ≤ log_{10}(n) < k

k ≤ 1 + log_{10}(n) < k + 1

So k is floor(1 + log_{10}(n))