github / github/copilot-cli

UI: Remaining requests percentage displays unrounded floating-point value

未关闭
#1,726 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:terminal-rendering
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

The "Remaining reqs." percentage in the UI displays unrounded floating-point values with excessive decimal places.
**Example:**
Remaining reqs.: 58.666666666666664%
**Expected:**
Remaining reqs.: 59%
## Root Cause
The percentage is computed from integer division (e.g. `remaining / total * 100`) but the result is rendered directly without rounding, exposing IEEE 754 floating-point representation artifacts.
## Suggested Fix
Round the percentage before display:
```diff
- `Remaining reqs.: ${(remaining / total * 100)}%`
+ `Remaining reqs.: ${Math.round(remaining / total * 100)}%`

### Affected version

v0.0.419

### Steps to reproduce the behavior

1. You can see it at the bottom right
Remaining reqs.: 58.666666666666664%

### Expected behavior

Remaining reqs.: 58.67%

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。