From 9ef9dd92df70562fe71d66d2698c7b94d059383e Mon Sep 17 00:00:00 2001 From: Lanta Date: Fri, 29 Sep 2023 14:20:38 +0200 Subject: [PATCH] s --- last_stats.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/last_stats.php b/last_stats.php index ee83a48..a0d6fa9 100644 --- a/last_stats.php +++ b/last_stats.php @@ -28,8 +28,6 @@ error_reporting(E_ALL); $players_matches = json_decode(file_get_contents('./data/player_last_stats.json'), true); - echo 2222222; - foreach ($players_matches as $player_datas) { echo ""; echo " @@ -50,8 +48,18 @@ error_reporting(E_ALL); $kills = number_format($player_data['kills'], 2, ',', ''); $humankills = number_format($player_data['humankills'], 2, ',', ''); $matches = $player_data['matches']; - //$KD_H = ($player_data['KD_H'] == "Infinity") ? "∞" : number_format($player_data['KD_H'], 2, ',', ''); - //$KD_ALL = ($player_data['KD_ALL'] == "Infinity") ? "∞" : number_format($player_data['KD_ALL'], 2, ',', ''); + $KD_H = ($player_data['KD_H'] == "Infinity") + ? "∞" + : (is_null($player_data['KD_H']) + ? "null" + : number_format($player_data['KD_H'], 2, ',', '')); + + $KD_ALL = ($player_data['KD_ALL'] == "Infinity") + ? "∞" + : (is_null($player_data['KD_ALL']) + ? "null" + : number_format($player_data['KD_ALL'], 2, ',', '')); + echo " @@ -59,8 +67,8 @@ error_reporting(E_ALL); - - + + "; }
$player_name$kills $humankills $matches$KD_H$KD_ALL