aboutsummaryrefslogtreecommitdiffstats
path: root/python/common.py
blob: 047a2d830b73ae0c770c7efbed5a7d6bf4f62626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os

if os.name =='nt':
    root = "//WDsentinel/share/CorpCDOs"
elif os.name == 'posix':
    root = '/home/share/CorpCDOs'

def sanitize_float(intex_float):
    try:
        intex_float = intex_float.replace(",", "")
        if "(" in intex_float:
            return - float(intex_float[1:-1])
        else:
            return float(intex_float)
    except (AttributeError, ValueError):
        return intex_float