Skip to content

Implement better formatting for low cost values#5459

Merged
kevinvandijk merged 11 commits intoKilo-Org:mainfrom
Schrolli91:better-cost-format
Feb 13, 2026
Merged

Implement better formatting for low cost values#5459
kevinvandijk merged 11 commits intoKilo-Org:mainfrom
Schrolli91:better-cost-format

Conversation

@Schrolli91
Copy link
Contributor

@Schrolli91 Schrolli91 commented Jan 28, 2026

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 formatCost in costFormatting.ts:
    (cost === 0 || cost > 0.05) ? cost.toFixed(2) : cost.toFixed(4);.

  • Replaced all toFixed(2) calls with formatCost(...).

  • Tests edited as well.

No breaking changes.

Screenshots

None

How to Test

  • Start extension and run a task with API provider (e.g. small request for cost <0.05 USD).
  • Check task header and history: Small costs show 4 decimals (e.g. $0.0023), larger 2 (e.g. $1.23).

@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: 4f2a7da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

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

Bastian Schroll and others added 7 commits January 28, 2026 14:00
$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
@Schrolli91
Copy link
Contributor Author

Is there anything to do left, to get a short review?

Copy link
Collaborator

@kevinvandijk kevinvandijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Lgtm!

@Schrolli91
Copy link
Contributor Author

Schrolli91 commented Feb 13, 2026

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 ! :)

@kevinvandijk
Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants