Skip to content

Commit dcd47bc

Browse files
committed
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.
1 parent 913c1b7 commit dcd47bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/src/modules/puterai/AIChatService.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ class AIChatService extends BaseService {
114114
await this.db.insert('ai_usage', values);
115115

116116
// USD cost from microcents
117-
const cost_usd = values.cost / 1000000;
117+
const cost_usc = values.cost / 1000000;
118+
const cost_usd = cost_usc / 100;
118119

119120
// Add to TrackSpendingService
120121
const svc_spending = this.services.get('spending');

0 commit comments

Comments
 (0)