mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-08 05:10:01 +08:00
✅ Repair self-test
This commit is contained in:
@@ -228,3 +228,19 @@ def is_valid_date(date_text: str, separator: str = "-") -> bool:
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
||||
def is_number(text: str) -> bool:
|
||||
"""是否为数字
|
||||
|
||||
参数:
|
||||
text: 文本
|
||||
|
||||
返回:
|
||||
bool: 是否为数字
|
||||
"""
|
||||
try:
|
||||
float(text)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user