Converting Repeating Decimals into Fractions

It is fairly easy to take a fraction and turn it into a repeating decimal by hand. This is simple division.

But being able to go in the other direction and turn a repeating decimal into a fraction would be a cool party trick.

Let us take "0.454545454545..." to illustrate the trick.

Simply take the number that repeats, in this case 45, and divide it by however many 9's as there are digits in the original number. Since 45 is 2 digits, then divide 45 by 99.
Now, 45/99 simplifies down to 5/11.
So, "0.454545454545..."  = 5/11

For more understanding, if the repeating number is 0.4564564564..., then divide 456 by 999 since it has 3 digits (which would simplify down to 152/333.

Simple!

Just make sure if you perform this as a "magic trick" of sorts, to simplify your fraction down before you blurt it out, to conceal the magic.

Why does this work?

0.123123123..... = 41/333

Let, K = 0.123123123.....
So, 1000K = 1000 × 0.123123123..... = 123.123123123....
Now, 1000K - K = 123.123123123.... - 0.123123123.....
=> 999K = 123.000
Therefore, K = 123/999 = 41/333