This commit is contained in:
salam committed 2026-05-23 16:35:19 +02:00
1 parent 1be9e2cbfb
commit 3a3df3e089
1 file changed
+1 -1
@@ -15,7 +15,7 @@ class HelperMoveingAverage
$last = count($arr); $last = count($arr);
foreach ($arr as $key => $value) { foreach ($arr as $key => $value) {
if ($key == 1) { if ($key == 1) {
$new[] = round(($arr[0] + $value + $arr[2]) / 3, 3); $new[] = round(($arr[0] + $value + $arr[2]) / 3, 1);
} elseif ($key > 1 && $key < $last - 1) { } elseif ($key > 1 && $key < $last - 1) {
$new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 1); $new[] = round(($arr[$key - 1] + $value + $arr[$key + 1]) / 3, 1);
} }