testing yuk
This commit is contained in:
@@ -28,7 +28,7 @@ export async function GET() {
|
||||
);
|
||||
}
|
||||
|
||||
// Group by tahun_angkatan and calculate average IPK
|
||||
// Kelompokkan berdasarkan tahun_angkatan dan hitung rata-rata IPK
|
||||
const groupedData = data.reduce((acc, item) => {
|
||||
const tahun = item.tahun_angkatan;
|
||||
if (!acc[tahun]) {
|
||||
@@ -39,7 +39,7 @@ export async function GET() {
|
||||
return acc;
|
||||
}, {} as Record<number, { sum: number; count: number }>);
|
||||
|
||||
// Convert to final format
|
||||
// Konversi ke format akhir
|
||||
const results: IPKData[] = Object.entries(groupedData).map(([tahun, data]) => ({
|
||||
tahun_angkatan: parseInt(tahun),
|
||||
rata_rata_ipk: Math.round((data.sum / data.count) * 100) / 100
|
||||
|
||||
Reference in New Issue
Block a user