github / github/copilot-cli

UI: Remaining requests percentage displays unrounded floating-point value

Đang mở
#1,726 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:terminal-rendering
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.