The decimal number of expansion of a rational number terminates if the denominator of rational number can be expressed if the denominator of rational number can be expressed as 2m 5n where m and n are non-negative integers and p and q both co-primes.
e.g. 3 / 10 = 3 / (21 x 51) = 0.3