litellm - 💡(How to fix) Fix [Feature]: Configurable decimal precision for spend/cost display in UI dashboard [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#25973Fetched 2026-04-18 05:52:42
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

Feature Description

Add a configurable setting to control the number of decimal places shown for USD spend/cost values in the LiteLLM Proxy UI dashboard.

Currently, spend values are displayed with high precision (e.g. $1,085.9525), which is noisy for users who only need approximate figures. It would be useful to have a setting — either a UI preference or an environment variable — to control display precision (e.g. 0 decimals for $1,086, or 2 decimals for $1,085.95).

Motivation

Values like $1,043.834 are easy to misread as $1,043,834 — the decimal point gets lost among the comma separators, making a thousand-dollar figure look like a million-dollar one. A configurable precision setting would reduce this ambiguity and improve readability across the dashboard — spend tables, charts, team/project views, etc.

Suggested Approach

Introduce a single constant or user-facing setting that controls the decimals argument passed to formatting functions like formatNumberWithCommas and getSpendString in ui/litellm-dashboard/src/utils/dataUtils.ts. This would propagate to all components that use these utilities.


This issue was drafted with the help of Claude Code.

extent analysis

TL;DR

Introduce a configurable setting to control the number of decimal places shown for USD spend/cost values in the LiteLLM Proxy UI dashboard by modifying the decimals argument in formatting functions.

Guidance

  • Identify the formatting functions formatNumberWithCommas and getSpendString in ui/litellm-dashboard/src/utils/dataUtils.ts and determine how to pass a dynamic decimals argument.
  • Consider adding a UI preference or environment variable to store the user's preferred decimal precision.
  • Update the components that use these utilities to respect the new precision setting.
  • Test the changes to ensure that the spend values are displayed with the correct number of decimal places.

Example

// Example of how to pass a dynamic decimals argument to formatNumberWithCommas
function formatNumberWithCommas(number: number, decimals: number) {
  return number.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
}

Notes

The implementation details may vary depending on the specific requirements and constraints of the project. It's essential to consider the potential impact on existing functionality and user experience.

Recommendation

Apply a workaround by introducing a configurable setting to control the number of decimal places, as this will provide a flexible solution that can be adjusted according to user needs.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Feature]: Configurable decimal precision for spend/cost display in UI dashboard [1 participants]