Converting Decimal Expansion of Rational Number to Fraction

Theorem
Let $x \in \Q$

Let $a_i$ and $b_j \in \Z$ be the digits in the base $10$ expansion of $x$.

Then the decimal expansion of $x$ can be converted to a fraction as shown below:


 * $0. a_1 a_2 \ldots a_m \dot b_1 b_2 \ldots \dot b_n = \dfrac {a_1 a_2 \ldots a_m b_1 b_2 \ldots b_n - a_1 a_2 \ldots a_m }{10^m \times \paren {10^n - 1 } }$

Proof
First we note that:

Therefore:

Therefore: