Converting repeating decimals to a/b form