DataPipeline/Importer.py
def checkValue(self, val, format=''):
        """Coerce a string to float if possible"""
        #add code to handle commas in thousand separators
        dec = self.decimalsymbol

        if format != '':
            return self.checkTime(val, format)
        if dec == '.':
            try:
                return float(val)
            except:
                return None
        else:
            try:
                return float(val.replace(".","").replace(dec,"."))
            except ValueError, e:
                #print e
                return None
Coerce a string to float if possible
Coerce a string to float if possible
Coerce a string to float if possible
def checkValue(self, val, format=''):
        dec = self.decimalsymbol
        if format != '':
            return self.checkTime(val, format)
        if dec == '.':
            try:
                return float(val)
            except:
                return None
        else:
            try:
                return float(val.replace(".","").replace(dec,"."))
            except ValueError, e:
                return None
def checkValue ( self , val , format = '' ) : dec = self . decimalsymbol if format != '' : return self . checkTime ( val , format ) if dec == '.' : try : return float ( val ) except : return None else : try : return float ( val . replace ( "." , "" ) . replace ( dec , "." ) ) except ValueError , e : return None
Coerce a string to float if possible
Coerce a string to float if possible
"""Coerce a string to float if possible""" #add code to handle commas in thousand separators #print e
self
val
format