fix(core): 明细用量美元保留 6 位小数

This commit is contained in:
2026-10-09 13:42:13 +08:00
parent 29f5f4f84c
commit 31d963e956
4 changed files with 33 additions and 4 deletions
+4 -2
View File
@@ -4,6 +4,7 @@ import {
resolveQpuTimeline,
sumUsage,
toUnixSec,
usageRowPrecise,
type LogItem,
} from "@new-api-key-usage/core";
import {
@@ -337,8 +338,9 @@ export function adminUsageRoutes() {
});
const items: LogItem[] = rows.map((row) => {
const { quota_usd } = sumUsage(
[{ quota: row.quota, created_at: row.created_at }],
const { quota_usd } = usageRowPrecise(
row.quota,
row.created_at,
timeline,
);
return {
+4 -2
View File
@@ -3,6 +3,7 @@ import {
ERR,
resolveQpuTimeline,
sumUsage,
usageRowPrecise,
toUnixSec,
type LogItem,
type PaymentItem,
@@ -265,8 +266,9 @@ export function memberViewRoutes() {
page_size,
});
const items: LogItem[] = rows.map((row) => {
const { quota_usd } = sumUsage(
[{ quota: row.quota, created_at: row.created_at }],
const { quota_usd } = usageRowPrecise(
row.quota,
row.created_at,
timeline,
);
return {