What is the best string to decimal code for floats i.e 0.5?

I have not been able to work out how to convert a string to afloat. I’ve tried a.isdecimal() , a.isdigit() and a.isnumeric().

float(‘0.5’)

0.5

>>> float('2')

2.0



>>> int('12')

12