Skip to content

Commit c815fb2

Browse files
authored
Add files via upload
1 parent 1aff4cb commit c815fb2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

script/process_order.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ def process_price_with_order(menu_dict, order):
5050
if top == None:
5151
top = item
5252
else:
53-
if top in chinese_char_dict:
53+
if top.isnumeric():
5454
top = chinese_to_arabic(top)
55-
try:
56-
top = int(top)
57-
except:
58-
top = 0
55+
top = int(top)
5956
price_dict[item] = {'amount':top, 'price':None}
6057
top = None
6158

@@ -84,7 +81,7 @@ def sum_up_total_line(total, none_list):
8481
return line
8582

8683
# write_xlsx()
87-
# data_dict = load_xlsx()
84+
# data_dict = load_xlsx('script/menu.xlsx')
8885
# menu_dict = process_data_to_menu(data_dict)
89-
# print(process_price_with_order(menu_dict, '100個火腿和7000個蛋糕和兩個大雞雞'))
90-
# print(process_price_with_order(menu_dict, '一個火腿和7000個蛋糕和兩個大雞雞'))
86+
# print(process_price_with_order(menu_dict, '100個火腿和7000個蛋糕'))
87+
# print(process_price_with_order(menu_dict, '兩千萬個雞腿和兩個蛋糕'))

0 commit comments

Comments
 (0)