Challenge 20 - wrong total

Any idea why I do not get the correct total.

// Use the value below whenever you need the value of Pi

const PI = 3.14159;

const sphereVolume = function (radius) {
//console.log(radius);
radius = Math.abs(radius);
volume = (4/3) * Math.PI * Math.pow(radius, 3);
volume = volume.toFixed(4);

var Volume = Number(volume);

return Volume;

};

const coneVolume = function (radius, height) {

return PI * radius * radius * (height / 3);
};

const prismVolume = function (height, width, depth) {
return Number(height * width * depth);

};

const totalVolume = function (solids) {
var total = 0;
var Total = 0;

for (const solid of solids){
console.log("type: ",solid.type);

if(solid.type === “sphere”){
total += sphereVolume(solid.radius);
// console.log("A: ", total);
}else if(solid.type==‘cone’){

 total += coneVolume(solid.radius, solid.height);

// console.log("B: ", total);
}else if(solid.type==‘prism’){

  total += prismVolume(solid.height, solid.width, solid.depth);

}
console.log("total: ", total);

Total = Number(total);

return Total;

}

};

2 posts were merged into an existing topic: Challenge 20 Megathread