From 1c45f8d5fb8c1a27ca060c9829df3b6e92ea94a7 Mon Sep 17 00:00:00 2001 From: pmario Date: Mon, 3 Mar 2025 16:55:38 +0100 Subject: [PATCH] fix .median sort function --- core/modules/filters/math.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/filters/math.js b/core/modules/filters/math.js index ed8e5eed6..6b1d45f08 100644 --- a/core/modules/filters/math.js +++ b/core/modules/filters/math.js @@ -128,7 +128,7 @@ exports.minall = makeNumericReducingOperator( exports.median = makeNumericArrayOperator( function(values) { var len = values.length, median; - values.sort(); + values.sort(function(a,b) {return a-b}); if(len % 2) { // Odd, return the middle number median = values[(len - 1) / 2];