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[