mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 12:41:05 +08:00
优化计数格式化函数
This commit is contained in:
parent
f2624dbcca
commit
9f5956e77a
|
@ -44,7 +44,13 @@ def format_hit_count(count: int) -> str:
|
||||||
if count_len <= 4:
|
if count_len <= 4:
|
||||||
return count_str
|
return count_str
|
||||||
else:
|
else:
|
||||||
return "_".join(count_str[i:i + 4] for i in range(0, count_len, 4))
|
# 先倒序
|
||||||
|
# 再插入
|
||||||
|
# 最后再倒序
|
||||||
|
count_str = count_str[::-1]
|
||||||
|
count_str = "_".join([count_str[i:i+4] for i in range(0, count_len, 4)])
|
||||||
|
count_str = count_str[::-1]
|
||||||
|
return count_str
|
||||||
|
|
||||||
|
|
||||||
def wrap_request(url: str, msg: NewMessage, client: IcaClient) -> Optional[dict]:
|
def wrap_request(url: str, msg: NewMessage, client: IcaClient) -> Optional[dict]:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user