Recall that $10^{d-1}$ has $d$ digits. So for any number $n,$ the number of digits of $n$ is given by solving $ 10^{d-1} = n,$ or $$d = 1 + \lfloor \log_{10}(n) \rfloor$$