diff --git a/frontend/admin/dashboard.php b/frontend/admin/dashboard.php index ea78013..aa23256 100644 --- a/frontend/admin/dashboard.php +++ b/frontend/admin/dashboard.php @@ -109,7 +109,7 @@ function applyPercentileFilter() { } const rows = document.getElementById('rankingList').querySelectorAll('tr'); if (rows.length === 0) return; - const showCount = Math.ceil(totalStudents * (percentile / 100)); + const showCount = Math.max(1, Math.floor(totalStudents * (percentile / 100))); rows.forEach(function(row, index) { row.style.display = index < showCount ? '' : 'none'; });