You want to repot your frangipani and have now bought a larger (or several) flower pot. Now the question is, how much soil (in liters) will fit in my flower pot? While we all studied math at some point, very few of us remember the formula for calculating the volume, so we’re here to help! How much soil do you need to buy? Calculate it yourself quickly! „` To calculate the volume of your flower pot, please enter the following measurements: 1.) Diameter of the pot at the opening
document.addEventListener(‚DOMContentLoaded‘, function () {How much soil fits in my flower pots?
2.) Diameter of the pot at the base
3.) Height of the pot
4.) Number of pots
Please enter the measurements in centimeters.
const wrapper = document.querySelector(‚.pot-volume-calculator‘);
if (!wrapper) return;
const heightInput = wrapper.querySelector(‚#potHeight‘);
const topInput = wrapper.querySelector(‚#topDiameter‘);
const bottomInput = wrapper.querySelector(‚#bottomDiameter‘);
const button = wrapper.querySelector(‚#calculatePotVolume‘);
const resultEl = document.getElementById(‚result‘);
if (!heightInput || !topInput || !bottomInput || !button || !resultEl) return;
button.addEventListener(‚click‘, function () {
const height = parseFloat(heightInput.value);
const topDiameter = parseFloat(topInput.value);
const bottomDiameter = parseFloat(bottomInput.value);
if (
isNaN(height) || height <= 0 ||
isNaN(topDiameter) || topDiameter <= 0 ||
isNaN(bottomDiameter) || bottomDiameter <= 0
) {
resultEl.textContent = 'Please enter valid values.';
return;
}
const R = topDiameter / 2;
const r = bottomDiameter / 2;
const volumeCm3 = (Math.PI * height * (R * R + R * r + r * r)) / 3;
const volumeLiters = volumeCm3 / 1000;
resultEl.textContent = volumeLiters.toFixed(2) + ' Liters';
});
});
Melde dich mit deiner E-Mail-Adresse und deinem Passwort an, um deine Bestellungen zu verwalten.
Wir haben dir einen 6-stelligen Sicherheitscode per E-Mail geschickt.
Mindestens 10 Zeichen, Groß- und Kleinbuchstaben, Zahl und Sonderzeichen.
Anmeldung am Server erfolgt
Erstellen Sie jetzt Ihr Kundenkonto: Behalten Sie Ihre Bestellungen im Blick und profitieren Sie von einem schnelleren Checkout.
Schließen Sie dieses Fenster nicht!
Schauen Sie in Ihre E-Mail und fügen Sie den 6-stelligen Code hier ein.
Registrierung wird durchgeführt…