2014年7月15日 星期二

Python convert string to float

def convFloat(value):
    try:
        return float(value)
    except Exception:
        return 0




References :
Checking if a string can be converted to float in Python - Stack Overflow

沒有留言:

張貼留言