mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-19 13:00:51 -04:00
fix(curriculum): update usage of the toFixed by removing this from the calculation (#58583)
This commit is contained in:
@@ -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--
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user