Skip to content

[MiMo] Usage percentage truncated to 0% for values under 1% #1734

Description

@Max0633

Bug Description

MiMo token plan usage percentage is displayed as 0% used in the menu bar when the actual usage is between 0% and 1% (e.g., 0.96%). The Xiaomi MiMo console correctly shows 1% (rounded up), but CodexBar truncates to integer.

Root Cause

In UsageFormatter.usageLine(), the format string "%.0f%% %@" truncates the percentage to zero decimal places. For MiMo's 38B token plan, 0.96% usage (363M / 38B) is displayed as % used instead of 1% used or .96% used.

swift // Current code in UsageFormatter.swift return String(format: "%.0f%% %@", clamped, suffix)

Expected Behavior

  • Values under 1% should show at least 1 significant digit
  • The Xiaomi console rounds 0.96% to 1%, which is the expected UX

Suggested Fix

Option A: Round to nearest integer:
swift let rounded = clamped.rounded() return String(format: "%d%% %@", Int(rounded), suffix)

Option B: Show one decimal place when under 10%:
swift let format = clamped < 10 ? "%.1f%%" : "%.0f%%" return String(format: "\(format) %@", clamped, suffix)

Environment

  • Provider: Xiaomi MiMo
  • Cookie source: Manual
  • Token plan: Pro (38B tokens/month)
  • Actual usage: ~0.96%, displayed as 0%

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-risk cleanup, docs, polish, ergonomics, or speculative feature.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.no-staleExempts this issue from stale automation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions