mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
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:
parent
913c1b7836
commit
dcd47bc4cf
@ -114,7 +114,8 @@ class AIChatService extends BaseService {
|
|||||||
await this.db.insert('ai_usage', values);
|
await this.db.insert('ai_usage', values);
|
||||||
|
|
||||||
// USD cost from microcents
|
// 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
|
// Add to TrackSpendingService
|
||||||
const svc_spending = this.services.get('spending');
|
const svc_spending = this.services.get('spending');
|
||||||
|
Loading…
Reference in New Issue
Block a user