For a rational number p/q to have terminating decimal representation, the prime factorisation of q should be of the form 2^m x 5^n, where m and n are non-negative integers.
Example :
Consider the simple example of 50/10.
Here q=10, which can be represented as 2¹ × 5¹ ( m=1 and n =1 ).
Thus it has a terminating decimal expansion, i.e, 0.5
Consider another example of 3/11.
11 cannot be expressed in the prescribed format. Hence it has a reccuring (or repeating) decimal expansion, i.e, 0.2727272727...