[PR #71] [MERGED] Fix IEC (1024) formatting (double i was being added) #79

Closed
opened 2026-03-04 12:24:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/brvphoenix/luci-app-wrtbwmon/pull/71
Author: @Quphoria
Created: 10/29/2023
Status: Merged
Merged: 10/30/2023
Merged by: @brvphoenix

Base: masterHead: patch-1


📝 Commits (1)

  • 2f287c5 Fix IEC (1024) formatting (double i was being added

📊 Changes

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

View changed files

📝 luci-app-wrtbwmon/htdocs/luci-static/resources/view/wrtbwmon/details.js (+2 -2)

📄 Description

The javascript String.format function, automatically detects that IEC (1024) is being used as a multiple, and adds the "i" for Kibi, Mibi, etc. So the code removed would have added an extra "i" making it KiiB, MiiB, etc.

> String.format('%1024.2mbit', 100000)
'97.66 Kibit'
> String.format('%1000.2mbit', 100000)
'100.00 Kbit'

🔄 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/brvphoenix/luci-app-wrtbwmon/pull/71 **Author:** [@Quphoria](https://github.com/Quphoria) **Created:** 10/29/2023 **Status:** ✅ Merged **Merged:** 10/30/2023 **Merged by:** [@brvphoenix](https://github.com/brvphoenix) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`2f287c5`](https://github.com/brvphoenix/luci-app-wrtbwmon/commit/2f287c53f6841d44aadcff8d48cd0d088ba274ce) Fix IEC (1024) formatting (double i was being added ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `luci-app-wrtbwmon/htdocs/luci-static/resources/view/wrtbwmon/details.js` (+2 -2) </details> ### 📄 Description The javascript String.format function, automatically detects that IEC (1024) is being used as a multiple, and adds the "i" for Kibi, Mibi, etc. So the code removed would have added an extra "i" making it KiiB, MiiB, etc. ```js > String.format('%1024.2mbit', 100000) '97.66 Kibit' > String.format('%1000.2mbit', 100000) '100.00 Kbit' ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 12:24:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/luci-app-wrtbwmon-brvphoenix#79
No description provided.