As a more general solution, writing a number $x$ in base $k$ actually means writing the series
$$x=\sum_{i=n}^N a_n k^n=a_n k^n+a_{n+1}k^{n+1}+\dots+a_N k^N$$
where the coefficients $a_n$ are integers in $[0,k-1]$, for some $n\le N$ and we allow $n$ to be negative or even $-\infty$ (in the case of non terminating $k$-simal expansion). For instance, the number $5/4\in\mathbb{R}$ is written in decimal as
$$5/4=(1.25)_{10}=1\cdot 10^{0}+2\cdot 10^{-1}+5\cdot 10^{-2}$$
or you could use base $2$ (for instance) and
$$5/4=1+\frac{1}{4}=1\cdot 2^{0}+0\cdot 2^{-1}+1\cdot 2^{-2}=(1.01)_2$$
Now, if your number is rational i.e. $x=a/b$ for some integers $a,b$ and your $k$-simal expansion terminates $m$ positions after the separator, you can write
$$\frac{a}{b}=x_{-m}k^{-m}+x_{-m+1}k^{-m+1}+\dots+x_N k^N$$
for some $N\ge m$. By multiplying by $k^m$, you get
$$\frac{k^m a}{b}=x_{-m}k^{0}+x_{-m+1}k^{1}+\dots+x_N k^{N+m}$$
but now the right hand side is an integer number, hence $b$ divides $k^m a$. Since we assumed that $(a,b)$ are coprime, this means that $b$ divides $k^m$, and in definitive $b$ is made of only those primes dividing $k$ (which, in the case $k=10$, are exactly $2$ and $5$).