mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 03:08:42 -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 renderStorage = () => {
|
||||||
const toNum = (val) => {
|
const toNum = (val) => {
|
||||||
if (val === undefined || val === null) return undefined;
|
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;
|
return Number.isNaN(n) ? undefined : n;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user