Hint for: Prove any terminating decimal can be represented as a rational number

I am currently working on a problem from Hardy and have been stuck trying to figure out what to do. I was wondering if someone could provide me with a hint that may help jump-start my thought process.

Here is the question:

Any terminating decimal represents a rational number whose denominator contains no factors other than 2 or 5. Conversely any such rational number can be expressed, and in one way only, as a terminated decimal.

My work so far:

Take an arbitrary terminating decimal, $d.d_1d_2...d_n$ where $d_i$ represents a positive integer.

Therefore, for the first part of the proof we need to prove the existence of a positive integer a, such that $a\times d.d_1d_2...d_n$ such that this product is an integer.

The existence of such as a can be proven simply by taking $a=10^n$ therefore, the rational number can be represented as $\frac{10^n\times d.d_1d_2...d_n}{10^n}$ Any common factor $b$ can be found such that this reduces to a rational number. This proves the first statement.

My concern:

My proof seems very "crude" and it doesn't seem to address the no factors other than 2 or 5 part of it. Also I cannot seem to get the converse to come from it.

I would appreciate a hint, if possible, to get me going in the right direction.

-
Relevant link - math.stackexchange.com/questions/198810/… – mistermarko Jun 25 '14 at 13:10

Your proof seems very nice to me. You have represented your decimal as a (potentially) reducible rational with $10^n$ as the denominator. Clearly reduction will not introduce any new factors into the denominator so the only factors of the denominators are the factors of $10$, i.e. $2$ and $5$.
The converse is similar. Consider a fraction of the form $$r=\frac{x}{2^a5^b}$$ If $a=b$ then it is easy to see that we have a terminating decimal with the same digits as $x$ (except shifted of course). If the factors on the bottom are unequal in power, then try to "complete" the $10$ to get a form similar to the previous case. You can then finish off by using the uniqueness of the decimal expansion for a number.
Your proof is fine for the part that any terminating decimal represents a rational number-you have demonstrated a rational number (depending a bit on your definition-if they have to be in lowest terms you need to clear common factors, as $0.2=\frac 15$ but you may not allow $\frac 2{10})$
The lowest terms helps you, though, in the only factors of the denominator are $2$ and $5$. You have a fraction with only those factors in the denominator, and removing common fractions can't add new ones.