I don't know if there is a way. For one thing, the floating point numbers are stored internally using binary, so that decimal 0.1 ends up with a repeating representation internally. Therefore, you are most likely interested only in whether the decimal representation repeats.
For example, 1/7 = 0.142857142857142857...
and 1/17 = 0.058823529411764705882352941176470...
But in the general case, you are likely to run out of precision before you are able to check this properly.
If the user inputs one of those numbers, how can I know whether the number is repeating or not?
That's impossible. You're asking me, the user to input a number. I input this number:
0.3333333
Can YOU tell me now if I mean one third (i.e. repeating), or if I actually mean exactly 0.3333333? You cannot. There is no way to know. You cannot program something that's impossible.