This commit is contained in:
salam committed 2026-05-23 17:14:58 +02:00
1 parent 789a6e699a
commit 27badf9140
3 files changed
+19 -3

No files matched your search

@@ -14,7 +14,7 @@ class HelperMoveingAverage
$new = [];
$last = count($arr);
foreach ($arr as $key => $value) {
if ($key == 1) {
if ($key == 1 && $last > 2) {
$new[] = round(($arr[0] + $value + $arr[2]) / 3, 1);
} elseif ($key > 1 && $key < $last - 1) {
$new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 1);