Assume your number base is $b>1$ and that you are given a rational number $r={p\over q}>0$ with $(p,q)=1$, meaning that $p$ and $q$ have no common divisors.
When long division $p:q$ performed in base $b$ finally ends with zero remainder this means that there is an $n\geq0$ and a certain natural number $k$ such that ${p\over q}={k\over b^n}$ or $p\ b^n=q\ k\ .$ As $(p,q)=1$ the denominator $q$ of the given rational number $r$ has to be a divisor of $b^n$ for sufficiently large $n$, and this means that $q$ may contain any prime divisors present in $b$ to arbitrary multiplicity, but no prime divisors prime to $b$. When $b=10$ then $q$ has to be of the form $q=2^j\ 5^k$ with $j\geq0$, $\ k\geq0$.
When $q$ is not of this form then the long division $p:q$ cannot end after a certain number of steps. Now in dividing by $q$ there are only $q-1$ different remainders $\ne0$. It follows that after a finite number of steps in the long division we have to meet a remainder we have seen before, say: $\ell$ steps ago. The consequence is that the whole computation will repeat from then on after every $\ell$ steps, so that in the end our $b$-adic fraction representing the rational $r$ becomes periodic with period $\ell$ (or smaller).
In elementary number theory these things are discussed in detail. In particular one treats the question, for which $q$ the resulting period has maximal length $q-1$. For $b=10$ one such number is $q=7$.