diff --git a/src.ts/providers/provider-fallback.ts b/src.ts/providers/provider-fallback.ts index b93999da8f..6be29c95da 100644 --- a/src.ts/providers/provider-fallback.ts +++ b/src.ts/providers/provider-fallback.ts @@ -250,7 +250,7 @@ function getMedian(quorum: number, results: Array): 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]; }