fix: fix microcents to USD conversion in AIChatService

This only affects a value sent to TrackSpendingService. Cost
calculations related to user's quotas / billing remain unaffected.
This commit is contained in:
KernelDeimos 2025-01-28 16:36:44 -05:00
parent 913c1b7836
commit dcd47bc4cf

View File

@ -114,7 +114,8 @@ class AIChatService extends BaseService {
await this.db.insert('ai_usage', values);
// USD cost from microcents
const cost_usd = values.cost / 1000000;
const cost_usc = values.cost / 1000000;
const cost_usd = cost_usc / 100;
// Add to TrackSpendingService
const svc_spending = this.services.get('spending');