fix: format cost display with 6 decimal precision in log details#2037
fix: format cost display with 6 decimal precision in log details#2037Radheshg04 wants to merge 1 commit intographite-base/2037from
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughA single line in the log details sheet has been modified to format cost values using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ui/app/workspace/logs/sheets/logDetailsSheet.tsx`:
- Line 341: The LogEntryDetailsView in logDetailsSheet.tsx currently formats
cost with .toFixed(6) and a manual `$` prefix causing inconsistent precision;
update the cost formatting to use the shared formatCost utility from
ui/app/workspace/dashboard/utils/chartUtils.ts (or change to .toFixed(4) to
match columns.tsx and page.tsx) for consistency, and ensure the `$` prefix is
applied uniformly (fix columns.tsx to include `$` if you choose .toFixed(4)).
Locate the cost usage in LogEntryDetailsView (value={log.cost ...}), the table
in columns.tsx, and the stats card in page.tsx and replace their ad-hoc
formatting with formatCost(log.cost) (or standardize to .toFixed(4) + `$`) so
all views match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d3a43f9b-76c4-4acb-a684-488dbbe8d118
📒 Files selected for processing (1)
ui/app/workspace/logs/sheets/logDetailsSheet.tsx

Summary
Fixed cost display formatting in the log details sheet to show costs with proper decimal precision and remove trailing zeros.
Changes
parseFloat(log.cost.toFixed(6))instead of directly displaying the raw cost valueType of change
Affected areas
How to test
Screenshots/Recordings
Before: Cost might display with excessive decimal places or formatting issues
After: Cost displays cleanly with appropriate precision
Breaking changes
Related issues
Security considerations
None - this is a display formatting change only.
Checklist
docs/contributing/README.mdand followed the guidelines