In this question, if I try to make convert 0.3333333 to fraction using this method,

x = 0.333333

10x = 3. 333333

9x = 3

x = \frac{1}{3}

then, it doesn’t work for fractions like 0.25 or any other fraction. What should I do? To manage stuff like this?