The numbers with terminating expansions are the rational numbers that can be expressed as an integer over a power of ten. The other rational numbers have expansions that are non terminating but eventually repeating.
For example consider
x = 0.12343434… where the block 34 keeps repeating
. Then
100 x - 12 = 0.3434…
Let y =. 0.3434…
Then 100y = 34.3434…,
so 100y - 34 = 0.3434.. = y. Solving 100y - 34 = y gives y = 34/99. Now solve 100x-12 =34/99to get x = 611/4950, which is rational.