fix(curriculum): update usage of the toFixed by removing this from the calculation (#58583)

This commit is contained in:
JungLee-Dev
2025-02-05 02:23:08 -07:00
committed by GitHub
parent 8f2dac41e5
commit 2269dc2acc
6 changed files with 7 additions and 7 deletions

View File

@@ -88,7 +88,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
--fcc-editable-region--

View File

@@ -93,7 +93,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {

View File

@@ -110,7 +110,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {

View File

@@ -90,7 +90,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {

View File

@@ -88,7 +88,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {

View File

@@ -62,7 +62,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return total / ratings.length.toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {
@@ -144,7 +144,7 @@ recipes.push(recipe1, recipe2, recipe3);
function getAverageRating(ratings) {
const total = ratings[0] + ratings[1] + ratings[2] + ratings[3];
return (total / ratings.length).toFixed(2);
return total / ratings.length;
}
function getTotalIngredients(ingredients) {