[PR #70] [MERGED] Fix percentage calculation #77

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

📋 Pull Request Information

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

Base: masterHead: patch-1


📝 Commits (2)

📊 Changes

1 file changed (+3 additions, -6 deletions)

View changed files

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

📄 Description

function progressbar(query, v, m, useBits, useMultiple) {
	var pg = $(query),
	    vn = v || 0,
	    mn = formatBandWidth(m, useBits) || 100,
	    fv = formatSpeed(v, useBits, useMultiple),
	    pc = '%.2f'.format((100 / mn) * vn),
	    ...

m is in Mbits/s, v is in bytes/s
m was getting converted to bytes/s when useBits was false, however, it wasn't when useBits was true, meaning all percentages were 1/8th what they should be


🔄 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/70 **Author:** [@Quphoria](https://github.com/Quphoria) **Created:** 10/28/2023 **Status:** ✅ Merged **Merged:** 10/29/2023 **Merged by:** [@brvphoenix](https://github.com/brvphoenix) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (2) - [`a35a9a8`](https://github.com/brvphoenix/luci-app-wrtbwmon/commit/a35a9a874abe8bfa93ae2a12680f849b732a1131) Fix percentage calculation - [`43b467d`](https://github.com/brvphoenix/luci-app-wrtbwmon/commit/43b467d5c965d25d631eb22d255f4e1c0cd2bc57) Update details.js ### 📊 Changes **1 file changed** (+3 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `luci-app-wrtbwmon/htdocs/luci-static/resources/view/wrtbwmon/details.js` (+3 -6) </details> ### 📄 Description ```js function progressbar(query, v, m, useBits, useMultiple) { var pg = $(query), vn = v || 0, mn = formatBandWidth(m, useBits) || 100, fv = formatSpeed(v, useBits, useMultiple), pc = '%.2f'.format((100 / mn) * vn), ... ``` m is in Mbits/s, v is in bytes/s m was getting converted to bytes/s when useBits was false, however, it wasn't when useBits was true, meaning all percentages were 1/8th what they should be --- <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:23 +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#77
No description provided.