Here's the procedure for terminating decimals : http://www.mathsisfun.com/converting-decimals-fractions.html
For repeating decimals, here's what I do :
Example : .127 with the "27" repeating
(1) Forget the decimal. Write 127 and from it subtract the non-repeating part, 1. So we have 127 - 1 = 126
(2) Write a number consisting of the same number of 9's as the digits that repeat and the same number of 0's as the non-repeating digits. So...we have two repeating digits........so write two 9s. And we have one non-repeating digit....so write one 0.........then....our number is 990
3) Put the result of (1) over the result of (2) → 126 / 990
Verify for yourself that this is equal to .1272727..........