mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-02 15:50:54 +08:00
fix: apikey用量百分比保留两位小数
This commit is contained in:
@@ -297,7 +297,7 @@ function formatQuota(num: number | null | undefined): string {
|
||||
function getQuotaPercentage(used: number | null | undefined, limit: number | null | undefined) {
|
||||
if (limit == null || limit === 0 || used == null)
|
||||
return 0;
|
||||
return Math.min((used / limit) * 100, 100);
|
||||
return Number(Math.min((used / limit) * 100, 100).toFixed(2));
|
||||
}
|
||||
|
||||
// 获取配额状态颜色
|
||||
|
||||
Reference in New Issue
Block a user