Files
codex/codex-rs/tui/src
Felipe Coury c37b7307db Format analytics credit usage with consistent decimal precision (#47086)
## Why

Chat analytics displayed raw credit strings, exposing values such as `0E-10` for plan-covered tasks and unnecessary trailing decimal zeros.

## What changed

Format ordinary credit amounts with two decimal places and thousands separators. Round directly from decimal digits to avoid floating-point rounding errors, so `1.005` becomes `1.01`. Normalize zero to `0.00`, while preserving the original strings for nonzero sub-cent amounts and values outside the safe conversion range.

## Testing

Add assertions for decimal and scientific notation, signed zero, rounding boundaries, tiny adjustments, and large values. Update the chat analytics snapshot to cover a plan-covered task showing `0.00` credits.

GitOrigin-RevId: f946cb408c2c37291447f90de02ebbb557fbc662
2026-09-21 18:38:18 +00:00
..
…
…
…