feat: adds decimals validator method

This commit is contained in:
2024-12-08 23:02:13 -03:00
parent 6b9b5e201f
commit ff9d94bb72

View File

@@ -9,4 +9,12 @@ class Validators:
regex = re.compile(pattern)
if(regex.match(string) is not None):
return True
return False
return False
@staticmethod
def is_valid_decimal(value: str):
try:
float(value)
return True
except:
return False