aboutsummaryrefslogtreecommitdiffstats
path: root/python/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/common.py')
-rw-r--r--python/common.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/common.py b/python/common.py
index f34e3efc..047a2d83 100644
--- a/python/common.py
+++ b/python/common.py
@@ -4,3 +4,13 @@ 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