To make this cover all possible cases, to convert a decimal into a fraction, you must have an infinitely repeating decimal pattern starting after some digit (e.g. 1.23454545... will work but $\pi$ will not because it's decimal pattern does not infinitely repeat).
If your repeating pattern is 0, e.g. 1.41=1.4100.., use Mariano Suárez-Alvarez's idea in the comments to your question - take all digits without decimal point as the first integer (i.e. 141 here) and take $10^n$ where $n$ is the number of digits after the decimal point as the second integer (here $10^2=100$ and use J.D.'s answer with the GCD to simplify the fraction (in our example, $141/100$ does not simplify).
If your pattern is not 0 (e.g. 1.2345[45] as above), then break the fraction into 2 parts, isolating the repeating pattern, and scale it by the right power of 10 to make it start at the first decimal point, i.e.
$1.23[45] = 1.23 + 0.45[45]/100.$
In that form, the infinitely repeating decimal can be written as a fraction where the top is the repeating pattern (here 45) and the bottom is the number of 9's equal to the digits in the pattern (here 2 digits, so 99). So 0.45[45] = 45/99 and overall you get [transforming the first part using the previously-given algorithm]:
$1.23[45] = \frac{123}{100} + \frac{45}{99 \cdot 100}$,
and now add fractions appropriately and use GCD algorithm below to simplify common fractions.