Because the repetition of 6s goes out forever, you can multply your example by 100 and the 6s still go on forever. And you get 1.66666
The fractional part of these two number is the same, again because the 6s go forever.
So then you can subtract one from the other and you get 1.66666… - 0.16666…
Which is exactly 1.5 with no repeating part.
Now we took the original number times 10 and subtracted the original number. So we have 10x - x which is (10 - 1)x which is 9x.
And so the answer is that x is 1.5 / 9 or 15/ 90 or 1/6.
In more general terms, you multiply the original number by the power of 10 it takes to shift by all the non-repeating part (your “0 per non repepeating digit”). Then you subtract to eliminate the repeating part. That gives the numerator
And your denominator from that operation will always be a number like 10-1 or 100 - 1 or 1000 - 1 , which explains the 9s.
That’s what’s going on as long as the repeating part isa single digit, 6 in our example.
It’s a bit more complex if you have a repeating pattern, such as 0.1234567456745674567 … . In that case the 123 is the non-repeating part and the 4567 is the repeating part. So to do the substraction which drops out the repeating part, you need to shift the decimla point to the right enough to not only pass the 123, but to ensure you align the 4567 in the bigger number with the 4567 in the smaller.
IOW, 123.45674567 would work as your bigger number to cancel the repeat, but 1234.56745674567 would not.
ETA - Must learn to type faster.