# Displaying the repeating decimal expansion of a rational number [duplicate]

How do I write a decimal expansion of a rational number $$a/b$$ with only periodic part, e.g., given $$1/7=0.14285714285714285714 \ldots$$, I want just $$0.142857$$, the periodic part of $$1/7$$, to be displayed. I think I was able to do it sometime ago (with RealDigit or something similar), but now I forget what I did.