If you need to convert a String to a Double in your Python code:

Option 1 – Convert String to Double using float()

1
2
3
string = '1234.5678'
myfloat = float(string)
print(myfloat)

Option 2 – Convert String to Double using decimal.Decimal()

1
2
3
4
5
from decimal import Decimal

string = '1234.5678'
myfloat = Decimal(string)
print(myfloat)