Answer:
this also depends on whether or not the decimal is terminal (ending) or not terminal. If the decimal isn't terminal, meaning irrational, then it CANNOT be written as a fraction.
For example: pi is 3.14159265... and will go on forever
many may say that 22/7 is the fraction form of pi, but it's not. it's the closest fraction to pi that scientists came up with.
hope this helps clearing up the fact that not ALL decimals can be written as fractions.