For a rational number to generate a repeating decimal, the denominator must not evenly divide any power of 10.
This means that if the denominator (in its simplest form) has prime factors other than 2 or 5, the decimal representation will be repeating. If the denominator consists only of the prime factors 2 and/or 5, then the decimal representation will terminate.