diff --git a/dist/better-xcloud.lite.user.js b/dist/better-xcloud.lite.user.js index e4f3bd8..4d64d78 100755 --- a/dist/better-xcloud.lite.user.js +++ b/dist/better-xcloud.lite.user.js @@ -2133,16 +2133,16 @@ class StreamStatsCollector { received: 0, dropped: 0, toString() { - let framesDroppedPercentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); - return framesDroppedPercentage === "0.0" ? this.dropped.toString() : `${this.dropped} (${framesDroppedPercentage}%)`; + let percentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); + return percentage.startsWith("0.") ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; } }, pl: { received: 0, dropped: 0, toString() { - let packetsLostPercentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); - return packetsLostPercentage === "0.0" ? this.dropped.toString() : `${this.dropped} (${packetsLostPercentage}%)`; + let percentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); + return percentage.startsWith("0.") ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; } }, dt: { diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index bc75e8d..6bed4b9 100755 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -2243,16 +2243,16 @@ class StreamStatsCollector { received: 0, dropped: 0, toString() { - let framesDroppedPercentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); - return framesDroppedPercentage === "0.0" ? this.dropped.toString() : `${this.dropped} (${framesDroppedPercentage}%)`; + let percentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); + return percentage.startsWith("0.") ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; } }, pl: { received: 0, dropped: 0, toString() { - let packetsLostPercentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); - return packetsLostPercentage === "0.0" ? this.dropped.toString() : `${this.dropped} (${packetsLostPercentage}%)`; + let percentage = (this.dropped * 100 / (this.dropped + this.received || 1)).toFixed(1); + return percentage.startsWith("0.") ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; } }, dt: { diff --git a/src/utils/stream-stats-collector.ts b/src/utils/stream-stats-collector.ts index 912ccd2..a09903e 100755 --- a/src/utils/stream-stats-collector.ts +++ b/src/utils/stream-stats-collector.ts @@ -127,8 +127,8 @@ export class StreamStatsCollector { received: 0, dropped: 0, toString() { - const framesDroppedPercentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1); - return framesDroppedPercentage === '0.0' ? this.dropped.toString() : `${this.dropped} (${framesDroppedPercentage}%)`; + const percentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1); + return percentage.startsWith('0.') ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; }, }, @@ -136,8 +136,8 @@ export class StreamStatsCollector { received: 0, dropped: 0, toString() { - const packetsLostPercentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1); - return packetsLostPercentage === '0.0' ? this.dropped.toString() : `${this.dropped} (${packetsLostPercentage}%)`; + const percentage = (this.dropped * 100 / ((this.dropped + this.received) || 1)).toFixed(1); + return percentage.startsWith('0.') ? this.dropped.toString() : `${this.dropped} (${percentage}%)`; }, },