aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/common.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/common.py b/python/common.py
new file mode 100644
index 00000000..557189a4
--- /dev/null
+++ b/python/common.py
@@ -0,0 +1,18 @@
+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: #case of combo notes
+ return float(intex_float.split(" ")[0])
+ if "(" in intex_float:
+ return - float(intex_float[1:-1])
+ else:
+ return float(intex_float)
+ except (AttributeError, ValueError):
+ return intex_float