fix: Round down number of rats if not int
This commit is contained in:
parent
cfe305e698
commit
168e4acf6a
@ -409,7 +409,7 @@ function updateNumRatsCalculator() {
|
||||
const validator = new Validator();
|
||||
const failed_checks = validator.failCageNumberIndependent(dimensions, numFullFloors);
|
||||
|
||||
let overallArea = validator.getOverallArea(dimensions, );
|
||||
let overallArea = validator.getOverallArea(dimensions, numFullFloors);
|
||||
let allowedNumRats;
|
||||
try {
|
||||
allowedNumRats = validator.allowedNumberOfRats(overallArea);
|
||||
@ -426,7 +426,7 @@ function updateNumRatsCalculator() {
|
||||
|
||||
resultsDiv.innerHTML = "";
|
||||
const p = document.createElement('p');
|
||||
p.textContent = i18next.t("cage-for-x-rats", {"num_rats": allowedNumRats});
|
||||
p.textContent = i18next.t("cage-for-x-rats", {"num_rats": Math.floor(allowedNumRats)});
|
||||
resultsDiv.appendChild(p);
|
||||
resultsDiv.appendChild(result);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user