mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-10 23:08:43 -06:00
fix: parse numeric storage values
This commit is contained in:
@@ -285,7 +285,10 @@ export default function DeviceDetails({ device, onBack }) {
|
||||
const renderStorage = () => {
|
||||
const toNum = (val) => {
|
||||
if (val === undefined || val === null) return undefined;
|
||||
const n = Number(val);
|
||||
if (typeof val === "number") {
|
||||
return Number.isNaN(val) ? undefined : val;
|
||||
}
|
||||
const n = parseFloat(String(val).replace(/[^0-9.]+/g, ""));
|
||||
return Number.isNaN(n) ? undefined : n;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user