Skip to content

Commit 3d596e3

Browse files
fix(ai-statusline): round rate limit percentages to 2 decimal places (v2.2.1)
1 parent e133d15 commit 3d596e3

File tree

6 files changed

+30
-14
lines changed

6 files changed

+30
-14
lines changed

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"metadata": {
88
"description": "A curated list of custom Claude Code plugins, agents, and skills for developers.",
9-
"version": "2.2.0",
9+
"version": "2.2.1",
1010
"pluginRoot": "./plugins"
1111
},
1212
"plugins": [
@@ -161,7 +161,7 @@
161161
"name": "ai-statusline",
162162
"source": "./plugins/ai-statusline",
163163
"description": "AI-powered status line customization - Interactive setup and edit wizards for configuring Claude Code's status line with progress bars, rate limit display, and customizable display options",
164-
"version": "1.2.2",
164+
"version": "1.2.3",
165165
"keywords": [
166166
"ai",
167167
"statusline",

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.2.1] - 2026-03-31
11+
12+
### Fixed
13+
14+
#### AI-Statusline Plugin (v1.2.3)
15+
16+
- **Fixed rate limit percentage display** - Rate limit percentages now round to 2 decimal places instead of showing long floating-point numbers (e.g., `5h:12.35%` instead of `5h:12.345678%`)
17+
- Bash: uses jq `(. * 100 | round) / 100` for rounding, extracts integer part for color threshold comparisons
18+
- PowerShell: uses `[math]::Round($val, 2)` instead of `[int]` cast which truncated to whole numbers
19+
1020
## [2.2.0] - 2026-03-31
1121

1222
### Added
@@ -803,7 +813,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
803813

804814
- README.md, CLAUDE.md, individual plugin READMEs, and MIT license
805815

806-
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.0.1...HEAD
816+
[Unreleased]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.2.1...HEAD
817+
[2.2.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.2.0...v2.2.1
818+
[2.2.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.1.0...v2.2.0
819+
[2.1.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.0.1...v2.1.0
807820
[2.0.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v2.0.0...v2.0.1
808821
[2.0.0]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.9.1...v2.0.0
809822
[1.9.1]: https://github.com/charlesjones-dev/claude-code-plugins-dev/compare/v1.9.0...v1.9.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Claude Code Plugins for Developers
22

3-
[![Version](https://img.shields.io/badge/version-2.2.0-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
3+
[![Version](https://img.shields.io/badge/version-2.2.1-blue.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/releases)
44
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
55
[![GitHub Issues](https://img.shields.io/github/issues/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/issues)
66
[![GitHub Stars](https://img.shields.io/github/stars/charlesjones-dev/claude-code-plugins-dev.svg)](https://github.com/charlesjones-dev/claude-code-plugins-dev/stargazers)

plugins/ai-statusline/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-statusline",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "AI-powered status line customization - Interactive setup and edit wizards for configuring Claude Code's status line with progress bars and customizable display options",
55
"author": {
66
"name": "Charles Jones",

plugins/ai-statusline/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Install jq using your package manager (see Requirements section above).
283283
## Plugin Details
284284

285285
- **Name:** AI-Statusline
286-
- **Version:** 1.2.2
286+
- **Version:** 1.2.3
287287
- **Type:** UI Customization
288288
- **Features:**
289289
- Skills: `/statusline-wizard`, `/statusline-edit`

plugins/ai-statusline/skills/statusline-wizard/SKILL.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,19 @@ fi
288288

289289
# Rate limits (requires Claude Code 2.1.80+)
290290
if [ "$SHOW_RATE_LIMITS" = true ]; then
291-
rl_5h=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
292-
rl_7d=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
291+
rl_5h=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty | (. * 100 | round) / 100')
292+
rl_7d=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty | (. * 100 | round) / 100')
293293

294294
if [ -n "$rl_5h" ] && [ -n "$rl_7d" ]; then
295-
if [ "$rl_5h" -lt 50 ]; then rl_5h_color='32'
296-
elif [ "$rl_5h" -lt 80 ]; then rl_5h_color='33'
295+
rl_5h_int=${rl_5h%%.*}
296+
rl_7d_int=${rl_7d%%.*}
297+
298+
if [ "$rl_5h_int" -lt 50 ]; then rl_5h_color='32'
299+
elif [ "$rl_5h_int" -lt 80 ]; then rl_5h_color='33'
297300
else rl_5h_color='31'; fi
298301

299-
if [ "$rl_7d" -lt 50 ]; then rl_7d_color='32'
300-
elif [ "$rl_7d" -lt 80 ]; then rl_7d_color='33'
302+
if [ "$rl_7d_int" -lt 50 ]; then rl_7d_color='32'
303+
elif [ "$rl_7d_int" -lt 80 ]; then rl_7d_color='33'
301304
else rl_7d_color='31'; fi
302305

303306
[ -n "$output" ] && output="$output · "
@@ -503,15 +506,15 @@ if ($SHOW_RATE_LIMITS) {
503506
$rl_parts = @()
504507
505508
if ($null -ne $rl.five_hour) {
506-
$rl_5h = [int]$rl.five_hour.used_percentage
509+
$rl_5h = [math]::Round($rl.five_hour.used_percentage, 2)
507510
if ($rl_5h -lt 50) { $rl_5h_color = $green }
508511
elseif ($rl_5h -lt 80) { $rl_5h_color = $yellow }
509512
else { $rl_5h_color = $red }
510513
$rl_parts += "${rl_5h_color}5h:${rl_5h}%$reset"
511514
}
512515
513516
if ($null -ne $rl.seven_day) {
514-
$rl_7d = [int]$rl.seven_day.used_percentage
517+
$rl_7d = [math]::Round($rl.seven_day.used_percentage, 2)
515518
if ($rl_7d -lt 50) { $rl_7d_color = $green }
516519
elseif ($rl_7d -lt 80) { $rl_7d_color = $yellow }
517520
else { $rl_7d_color = $red }

0 commit comments

Comments
 (0)