Results
Utilization Rate represents the percentage of a resource that is actively being used. A high utilization rate might indicate efficiency but could also point to potential overuse or lack of buffer capacity. A low utilization rate might suggest underutilization and opportunities for optimization or reallocation.
.calculator-container {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
background-color: #f9f9f9;
}
.calculator-inputs, .calculator-results {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #eee;
border-radius: 5px;
background-color: #fff;
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #333;
}
.input-group input[type="number"] {
width: calc(100% – 80px);
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
.input-group .unit {
display: inline-block;
margin-left: 5px;
font-style: italic;
color: #666;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #45a049;
}
#result {
font-size: 1.2em;
font-weight: bold;
color: #d9534f;
margin-top: 10px;
}
function calculateUtilizationRate() {
var totalCapacity = parseFloat(document.getElementById("totalCapacity").value);
var usedCapacity = parseFloat(document.getElementById("usedCapacity").value);
var resultDiv = document.getElementById("result");
if (isNaN(totalCapacity) || isNaN(usedCapacity) || totalCapacity < 0 || usedCapacity totalCapacity) {
resultDiv.innerHTML = "Amount Used cannot exceed Total Capacity.";
resultDiv.style.color = "#f0ad4e";
return;
}
var utilizationRate = (usedCapacity / totalCapacity) * 100;
resultDiv.innerHTML = utilizationRate.toFixed(2) + "%";
resultDiv.style.color = "#5cb85c";
}