Fix median sort

This commit is contained in:
Herbert Wolverson 2025-01-30 12:41:59 -06:00
parent 61ce1e6b57
commit 9370d09cf6

View File

@ -249,14 +249,14 @@ export class ThroughputBpsDash extends BaseDashlet{
// Get the median from upRing
let upMedian = 0;
if (this.upRing.length > 0) {
this.upRing.sort();
this.upRing.sort((a, b) => a - b);
upMedian = this.upRing[Math.floor(this.upRing.length / 2)];
}
// Get the median from dlRing
let dlMedian = 0;
if (this.dlRing.length > 0) {
this.dlRing.sort();
this.dlRing.sort((a, b) => a - b);
dlMedian = this.dlRing[Math.floor(this.dlRing.length / 2)];
}