Pretend someone hands you a real number between 0 and 1 (not including 0 or 1). All you know is that its decimal expansion terminates. What could you do to determine the number of decimal places in this expansion (ignoring potentially just adding zeros to the last significant digit)?
I'm thinking maybe something like if the difference between that number and 10^(-k), for some positive integer k, is less than something? I'm not entirely sure.
Call this number $q$. The number of significant digits is given by $$\min\{n\in\mathbb{Z}:10^nq\in\mathbb{Z}\}$$ A simple way to compute this is to multiply $q$ by powers of $10$ until you get an integer.