Code:
class LGTypeConverter: # converts strings types to number typed variables def __init__(self): self.r1: RegexUtil = RegexUtil() def convertToInt(self, v1: str) -> int: temp: str = self.r1.extractEnumRegex(enumRegexGrimoire.integer,v1) if temp == "": return 0 return int(temp) def convertToFloat(self, v1: str) -> int: temp: str = self.r1.extractEnumRegex(enumRegexGrimoire.double_num,v1) if temp == "": return 0 return float(temp) def convertToFloat(self, v1: str, precision:int) -> int: # precision: how many numbers after the . temp: str = self.r1.extractEnumRegex(enumRegexGrimoire.double_num,v1) if temp == "": return 0 return round(float(temp),precision)