fix string to float conversion
This commit is contained in:
parent
9189d4aa0e
commit
a8d66a8ae6
@ -34,7 +34,7 @@ async function populateForm (node, type, vmid) {
|
||||
sata = `{"${sata.replaceAll(":", '":"').replaceAll("=", '":"').replaceAll(",", '","')}"}`;
|
||||
sata = JSON.parse(sata);
|
||||
let sizeUnit = sata.size.includes("G") ? "GiB" : "MiB";
|
||||
addFormLine("resources", `SATA ${i}`, {type: "number", value: sizeUnit === "GiB" ? (sata.size).toFixed(3) : (sata.size / 1024).toFixed(3), min: 0.016}, "GiB");
|
||||
addFormLine("resources", `SATA ${i}`, {type: "number", value: sizeUnit === "GiB" ? +(sata.size).toFixed(3) : +(sata.size / 1024).toFixed(3), min: 0.016}, "GiB");
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user