mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: The comparator is greater than or less than the supported string comparison (#4081)
This commit is contained in:
parent
ccf6d86dea
commit
3fad820e99
|
|
@ -21,4 +21,8 @@ class GECompare(Compare):
|
|||
try:
|
||||
return float(source_value) >= float(target_value)
|
||||
except Exception as e:
|
||||
try:
|
||||
return str(source_value) >= str(target_value)
|
||||
except Exception as _:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -21,4 +21,8 @@ class GTCompare(Compare):
|
|||
try:
|
||||
return float(source_value) > float(target_value)
|
||||
except Exception as e:
|
||||
try:
|
||||
return str(source_value) > str(target_value)
|
||||
except Exception as _:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -21,4 +21,8 @@ class LECompare(Compare):
|
|||
try:
|
||||
return float(source_value) <= float(target_value)
|
||||
except Exception as e:
|
||||
try:
|
||||
return str(source_value) <= str(target_value)
|
||||
except Exception as _:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -21,4 +21,8 @@ class LTCompare(Compare):
|
|||
try:
|
||||
return float(source_value) < float(target_value)
|
||||
except Exception as e:
|
||||
try:
|
||||
return str(source_value) < str(target_value)
|
||||
except Exception as _:
|
||||
pass
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in New Issue