From 199185a2791c9c36f5d6376c73d86366e47cfc87 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 8 Apr 2024 20:11:40 -0400 Subject: [PATCH] Fix Rounding Percents for tasks and tickets --- project_details.php | 4 ++-- projects.php | 4 ++-- ticket.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/project_details.php b/project_details.php index 128f8274..0bd33c44 100644 --- a/project_details.php +++ b/project_details.php @@ -66,7 +66,7 @@ if (isset($_GET['project_id'])) { $closed_ticket_count = mysqli_num_rows($sql_closed_tickets); if($ticket_count) { - $tickets_closed_percent = ($closed_ticket_count / $ticket_count) * 100; + $tickets_closed_percent = round(($closed_ticket_count / $ticket_count) * 100); } // Get All Tasks @@ -89,7 +89,7 @@ if (isset($_GET['project_id'])) { // Tasks Completed Percent if($task_count) { - $tasks_completed_percent = ($completed_task_count / $task_count) * 100; + $tasks_completed_percent = round(($completed_task_count / $task_count) * 100); } //Get Total Ticket Time diff --git a/projects.php b/projects.php index 5237ad61..04f2d527 100644 --- a/projects.php +++ b/projects.php @@ -161,7 +161,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); // Ticket Closed Percent if($ticket_count) { - $tickets_closed_percent = ($closed_ticket_count / $ticket_count) * 100; + $tickets_closed_percent = round(($closed_ticket_count / $ticket_count) * 100); } // Get All Tasks $sql_tasks = mysqli_query($mysqli, @@ -182,7 +182,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); // Tasks Completed Percent if($task_count) { - $tasks_completed_percent = ($completed_task_count / $task_count) * 100; + $tasks_completed_percent = round(($completed_task_count / $task_count) * 100); } ?> diff --git a/ticket.php b/ticket.php index 4265e2bf..fe62c482 100644 --- a/ticket.php +++ b/ticket.php @@ -274,7 +274,7 @@ if (isset($_GET['ticket_id'])) { // Tasks Completed Percent if($task_count) { - $tasks_completed_percent = ($completed_task_count / $task_count) * 100; + $tasks_completed_percent = round(($completed_task_count / $task_count) * 100); } // Get all Assigned ticket Users as a comma-separated string