feat: adds decimals validator method
This commit is contained in:
@@ -9,4 +9,12 @@ class Validators:
|
|||||||
regex = re.compile(pattern)
|
regex = re.compile(pattern)
|
||||||
if(regex.match(string) is not None):
|
if(regex.match(string) is not None):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def is_valid_decimal(value: str):
|
||||||
|
try:
|
||||||
|
float(value)
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
return False
|
||||||
Reference in New Issue
Block a user