Print the unix load with 2 decimal digits on ACP IndexPage
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Feb 2021 13:00:14 +0000 (14:00 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Feb 2021 13:00:41 +0000 (14:00 +0100)
wcfsetup/install/files/lib/acp/page/IndexPage.class.php

index fdd87b5938f0ea86fa65f2580275d2a18ac3323e..56057f962a821b791167b96439b6a6aa8d53a82f 100755 (executable)
@@ -63,7 +63,12 @@ class IndexPage extends AbstractPage
         if (\function_exists('sys_getloadavg')) {
             $load = \sys_getloadavg();
             if (\is_array($load) && \count($load) == 3) {
-                $this->server['load'] = \implode(', ', $load);
+                $this->server['load'] = \implode(
+                    ', ',
+                    \array_map(static function (float $value) {
+                        return \sprintf('%.2F', $value);
+                    }, $load)
+                );
             }
         }
     }