Commit e82e2b6
committed
Fix percentage calculation to match ccusage exactly
π CRITICAL FIX: Percentage calculation mismatch
β Problem:
- App showed 62% when user had no quota left
- App calculated: (currentTokens / limit) Γ 100 = 62%
- ccusage calculated: (projectedTokens / limit) Γ 100 = 114%
β
Solution:
- Now uses ccusage's percentUsed value directly
- Shows 114% (exceeds limit) instead of 62%
- Matches ccusage CLI output exactly
- leftPct = max(0, 100 - usedPct) for over-limit cases
This ensures the menu bar shows the same percentage as ccusage CLI,
properly indicating when quota is exceeded.1 parent ed3f3eb commit e82e2b6
1 file changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
0 commit comments