From dbcacdefc3c2329f7a3ab49712f6a81b300aa04b Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Wed, 28 Dec 2022 00:11:25 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9B=B4=E5=8A=A0=E7=B2=BE=E7=BB=86?= =?UTF-8?q?=E7=9A=84=E8=B4=B9=E7=94=A8=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/database/manager.py | 2 +- pkg/qqbot/process.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/database/manager.py b/pkg/database/manager.py index 3ede5f57..cbe243e9 100644 --- a/pkg/database/manager.py +++ b/pkg/database/manager.py @@ -64,7 +64,7 @@ class DatabaseManager: `id` INTEGER PRIMARY KEY AUTOINCREMENT, `key_md5` varchar(255) not null, `timestamp` bigint not null, - `fee` DECIMAL(9,3) not null + `fee` DECIMAL(12,6) not null ) """) print('Database initialized.') diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index eadde547..025ac556 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -118,8 +118,8 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str) -> using_key_name = "" for api_key in api_keys: reply_str += "{}:\n - {}元 {}%\n".format(api_key, - pkg.openai.manager.get_inst().key_mgr.get_fee( - api_keys[api_key]), + round(pkg.openai.manager.get_inst().key_mgr.get_fee( + api_keys[api_key]), 6), round( pkg.openai.manager.get_inst().key_mgr.get_fee( api_keys[