Skip to content

Commit

Permalink
Fixed FallbackProvider median calculation (#3746).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 14, 2023
1 parent 179e6ca commit 83957dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src.ts/providers/provider-fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]; }
Expand Down

0 comments on commit 83957dc

Please sign in to comment.