Auto-format code 🧹🌟🤖

This commit is contained in:
Formatter [BOT] 2024-11-27 10:31:40 +00:00
parent 9a1b9d1949
commit 93d2047c7a

View File

@ -527,9 +527,9 @@ def chinese_to_number(chinese):
unit = 1
num = 0
# 处理特殊情况:以"十"开头时,在前面加"一"
if chinese.startswith(''):
chinese = '' + chinese
if chinese.startswith(""):
chinese = "" + chinese
# 如果只有一个字符且是单位,直接返回其值
if len(chinese) == 1 and chinese_to_arabic[chinese] >= 10:
return chinese_to_arabic[chinese]
@ -544,7 +544,7 @@ def chinese_to_number(chinese):
else:
num += val * unit
result += num
return result