hi all,how can I repeat decimal numbers to print out?

for example:

1/6=0.1666.. repeating cycle is 6 and cycle length is 1

5/7=0.71428571428571...repeating cycle is 714285 and cycle length is 6

but

1/250=0.00400..repeating cycle is 0 and cycle length is 1

I hope anyone can help me out!Thanx in advance!!