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
..
2026-09-21 18:38:18 +00:00
2026-09-21 18:36:13 +00:00
2026-09-20 00:34:38 +00:00
2026-09-20 16:59:00 +00:00
2026-08-31 00:20:06 +00:00
2026-09-21 18:19:34 +00:00
2026-09-21 18:36:13 +00:00
2026-09-20 00:04:04 +00:00
2026-09-11 17:43:36 +00:00
2026-09-20 18:06:04 +00:00
2026-09-20 00:34:38 +00:00
2026-09-20 00:04:04 +00:00
2026-09-21 16:36:01 +00:00
2026-09-18 22:40:37 +00:00
2026-08-29 06:05:28 +00:00
2026-09-20 20:20:00 +00:00
2026-09-20 03:02:25 +00:00
2026-09-21 03:38:46 +00:00
2026-09-20 18:06:04 +00:00
2026-09-20 00:34:38 +00:00
2026-09-19 19:21:35 +00:00
2026-09-03 01:46:37 +00:00
2026-09-19 19:14:11 +00:00
2026-09-20 00:06:25 +00:00
2026-09-20 20:20:00 +00:00
2026-09-20 23:23:13 +00:00
2026-09-20 16:16:46 +00:00
2026-09-21 03:38:46 +00:00
2026-09-19 17:46:43 +00:00
2026-09-19 20:24:20 +00:00
2026-09-18 23:16:04 +00:00
2026-09-20 00:04:04 +00:00
2026-09-21 03:02:45 +00:00
2026-09-21 16:42:35 +00:00
2026-09-20 00:04:04 +00:00
2026-09-03 16:21:10 +00:00
2026-09-20 18:26:14 +00:00
2026-09-20 18:26:14 +00:00
2026-09-20 16:16:46 +00:00
2026-09-07 20:25:30 +00:00
2026-09-16 01:50:27 +00:00
2026-09-08 05:39:17 +00:00
2026-09-21 06:09:42 +00:00
2026-09-19 20:24:41 +00:00
2026-09-17 04:53:51 +00:00
2026-09-20 00:03:43 +00:00
2026-09-21 03:02:45 +00:00
2026-08-26 21:39:05 +00:00
2026-09-04 01:46:55 +00:00
2026-09-04 01:46:55 +00:00
2026-09-18 22:40:37 +00:00
2026-09-18 22:40:37 +00:00
2026-09-14 15:30:22 +00:00
2026-08-31 00:20:06 +00:00
2026-09-02 21:50:51 +00:00
2026-08-04 16:53:33 +00:00
2026-09-21 00:22:58 +00:00
2026-09-17 02:46:49 +00:00
2026-09-20 02:59:37 +00:00
2026-09-21 03:38:46 +00:00
2026-09-04 20:38:08 +00:00
2026-09-20 16:52:02 +00:00
2026-09-20 16:52:02 +00:00
2026-09-03 00:45:48 +00:00
2026-09-20 02:59:37 +00:00
2026-09-12 00:20:30 +00:00
2026-09-08 19:06:42 +00:00
2026-09-20 00:04:04 +00:00
2026-09-20 00:04:04 +00:00
2026-09-20 16:59:00 +00:00
2026-09-20 16:59:00 +00:00
2026-09-17 05:26:45 +00:00
2026-09-04 03:30:21 +00:00
2026-09-04 03:30:21 +00:00
2026-09-19 01:21:32 +00:00
2026-09-19 20:24:20 +00:00
2026-08-31 21:36:49 +00:00
2026-09-02 04:20:38 +00:00
2026-09-21 06:09:42 +00:00
2026-09-20 18:06:04 +00:00
2026-09-20 18:06:04 +00:00
2026-09-19 00:14:40 +00:00
2026-09-19 00:14:40 +00:00
2026-09-03 16:21:10 +00:00
2026-09-03 16:21:10 +00:00
2026-09-10 00:57:33 +00:00
2026-09-20 00:06:25 +00:00
2026-08-04 16:53:33 +00:00
2026-09-04 00:31:51 +00:00
2026-09-19 17:46:43 +00:00
2026-09-03 16:21:10 +00:00
2026-09-19 20:24:41 +00:00
2026-09-19 17:46:43 +00:00
2026-09-20 20:20:00 +00:00
2026-09-20 16:16:46 +00:00
2026-09-20 20:20:00 +00:00
2026-09-21 03:38:46 +00:00
2026-08-24 21:39:48 +00:00
2026-09-21 03:38:46 +00:00
2026-09-21 03:38:46 +00:00
2026-09-05 20:39:46 +00:00
2026-09-11 00:59:27 +00:00
2026-09-11 00:59:27 +00:00
2026-09-19 17:46:43 +00:00
2026-09-21 03:38:46 +00:00
2026-09-19 17:46:43 +00:00
2026-09-21 03:38:46 +00:00
2026-08-27 23:10:10 +00:00
2026-09-18 23:15:39 +00:00
2026-09-20 00:04:04 +00:00
2026-08-17 17:10:16 +00:00
2026-09-20 02:59:37 +00:00
2026-09-07 00:56:16 +00:00
2026-09-07 00:56:16 +00:00
2026-09-19 19:14:11 +00:00
2026-09-19 19:14:11 +00:00
2026-09-20 18:26:14 +00:00
2026-09-03 05:24:31 +00:00
2026-09-07 03:19:57 +00:00
2026-09-19 19:21:35 +00:00
2026-09-15 21:19:08 +00:00
2026-09-02 22:45:19 +00:00
2026-09-20 22:55:19 +00:00
2026-09-20 16:16:46 +00:00
2026-09-16 22:14:53 +00:00
2026-09-16 22:14:53 +00:00
2026-09-17 14:47:42 +00:00
2026-09-07 00:56:16 +00:00
2026-09-17 02:46:49 +00:00
2026-09-04 20:38:08 +00:00
2026-08-25 17:17:01 +00:00
2026-08-17 22:44:37 +00:00
2026-09-17 02:46:49 +00:00
2026-09-07 04:59:12 +00:00
2026-09-20 02:59:37 +00:00
2026-09-20 00:06:00 +00:00
2026-09-16 00:21:49 +00:00
2026-08-17 17:10:16 +00:00
2026-09-20 20:20:00 +00:00
2026-09-20 20:38:26 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 16:16:46 +00:00
2026-09-20 00:06:25 +00:00
2026-09-21 02:46:32 +00:00
2026-08-14 20:38:52 +00:00
2026-08-14 20:38:52 +00:00
2026-09-20 16:59:00 +00:00
2026-09-20 16:59:00 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 16:16:46 +00:00
2026-09-20 03:02:25 +00:00
2026-09-08 21:41:02 +00:00
2026-09-08 21:41:02 +00:00
2026-09-10 22:55:04 +00:00
2026-08-24 02:46:56 +00:00
2026-09-03 06:02:25 +00:00
2026-09-20 16:51:37 +00:00
2026-09-21 17:28:14 +00:00
2026-09-19 20:22:48 +00:00
2026-09-20 00:04:04 +00:00
2026-09-19 17:46:43 +00:00
2026-09-20 17:25:15 +00:00
2026-08-13 00:30:08 +00:00
2026-09-11 23:28:38 +00:00
2026-09-18 22:51:10 +00:00
2026-09-20 17:58:19 +00:00
2026-09-19 19:11:54 +00:00
2026-09-19 19:21:35 +00:00
2026-09-11 16:20:50 +00:00
2026-09-11 16:20:50 +00:00
2026-09-20 00:04:04 +00:00
2026-09-19 20:24:20 +00:00
2026-09-19 20:24:20 +00:00
2026-09-21 03:02:45 +00:00
2026-09-20 00:04:04 +00:00
2026-08-04 19:05:45 +00:00
2026-09-20 00:06:25 +00:00
2026-09-21 03:02:45 +00:00
2026-09-11 17:43:36 +00:00
2026-09-20 03:02:02 +00:00
2026-09-20 18:26:14 +00:00
2026-09-19 20:24:20 +00:00
2026-09-19 19:14:11 +00:00
2026-09-20 00:04:04 +00:00
2026-09-16 03:43:59 +00:00
2026-09-20 00:04:04 +00:00
2026-09-19 17:03:26 +00:00
2026-09-16 03:43:59 +00:00
2026-08-30 00:42:00 +00:00
2026-09-17 18:20:28 +00:00
2026-09-17 18:20:28 +00:00
2026-09-08 23:37:26 +00:00
2026-09-05 18:06:26 +00:00
2026-09-05 18:06:26 +00:00
2026-09-19 20:22:48 +00:00
2026-09-19 20:24:20 +00:00