Fixed FallbackProvider median calculation (#3746).

This commit is contained in:
Richard Moore 2023-02-14 11:54:08 -05:00
parent 179e6ca520
commit 83957dc283

@ -250,7 +250,7 @@ function getMedian(quorum: number, results: Array<TallyResult>): undefined | big
// Get the sorted values
values.sort((a, b) => ((a < b) ? -1: (b > a) ? 1: 0));
const mid = values.length / 2;
const mid = Math.floor(values.length / 2);
// Odd-length; take the middle value
if (values.length % 2) { return values[mid]; }