[PR #14790] fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes #20111

Open
opened 2026-04-16 07:26:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14790
Author: @LincolnBurrows2017
Created: 3/12/2026
Status: 🔄 Open

Base: mainHead: fix/bytes-unit-consistency


📝 Commits (1)

  • 1610516 fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 format/bytes.go (+4 -4)

📄 Description

Description

The HumanBytes function uses 1024-based multipliers (TeraByte, GigaByte, etc.) but displays decimal units (TB, GB, MB, KB). This fix updates the display to use binary units (TiB/GiB/MiB/KiB) to be consistent with the calculation.

Changes

  • Changed unit display from TB/GB/MB/KB to TiB/GiB/MiB/KiB in format/bytes.go

This ensures consistency between the calculation (using 1024-based values) and the displayed units (binary notation).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14790 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bytes-unit-consistency` --- ### 📝 Commits (1) - [`1610516`](https://github.com/ollama/ollama/commit/16105164eb08d8957261aac4a284b10bc25e4973) fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `format/bytes.go` (+4 -4) </details> ### 📄 Description ## Description The `HumanBytes` function uses 1024-based multipliers (TeraByte, GigaByte, etc.) but displays decimal units (TB, GB, MB, KB). This fix updates the display to use binary units (TiB/GiB/MiB/KiB) to be consistent with the calculation. ## Changes - Changed unit display from TB/GB/MB/KB to TiB/GiB/MiB/KiB in `format/bytes.go` This ensures consistency between the calculation (using 1024-based values) and the displayed units (binary notation). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:26:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20111