Python 3, 90 bytes
lambda s:g(int(s.replace(".","")),10**s[::-1].index("."))
g=lambda a,b:a-1and g(b%a,a)or b
Format: must have a decimal point in the string.
Leaky Nun
- 50.6k
- 6
- 115
- 291
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange