Implement better formatting for low cost values#5459
Implement better formatting for low cost values#5459kevinvandijk merged 11 commits intoKilo-Org:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 4f2a7da The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
$0 will stay at 2 decimal points now
Update renders cost information test and add one for the zero amount case and one for the high amount case
Update renders cost information test and add one for the zero amount case and one for the high amount case
|
Is there anything to do left, to get a short review? |
43b14c6 to
0b68de3
Compare
0b68de3 to
252ff65
Compare
|
Just saw you took over the test fixes while I was working on them. Looks like I also missed a few spots for the helper refactor. Thanks for jumping in @kevinvandijk ! :) |
I think some of them broke due to me merging main in as well :) Btw, if you want to. Please reach out to me on Discord (Kevin) with the email address you used to sign up for Kilo so I can grant you some credits as appreciation for your first PR! |
Context
Improved cost display in KiloCode Extension: For costs above $0.05, keep 2 decimal places. For lower costs, show 4 decimal places to better see small amounts.. Affects all relevant components (KiloTaskHeader, TaskItemFooter, CondensationResultRow, TaskHeader).
Implementation
Added new function
formatCostincostFormatting.ts:(cost === 0 || cost > 0.05) ? cost.toFixed(2) : cost.toFixed(4);.Replaced all
toFixed(2)calls withformatCost(...).Tests edited as well.
No breaking changes.
Screenshots
None
How to Test
$0.0023), larger 2 (e.g.$1.23).