fix string to float conversion
This commit is contained in:
parent
0c4917c77a
commit
d3d2670198
@ -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