I was hoping someone could guide me maybe it can’t be done? I have a function and I’m trying to remove the decimal (I want a whole number return)
function studentsPerAdmin(students, teachers, helpers) {
const average = students / (teachers + helpers);
if (average > 10) {
console.log(`There are on average ${average} students for each educator.`);
} else {
console.log('Unfortunately this class will be cancelled due to not having enough students enrolled.');
}
return average
}
studentsPerAdmin(41, 1, 2)
I’ve tried using the math functions such as math.round()
but I’m still learning and I don’t think I’m using it correctly. So far the result is
There are on average 13.666666666666666 students for each educator.