Skip to content

Commit 4d1180f

Browse files
Copilotdorkmo
andcommitted
Add negative value check to formatFeetInches function
Co-authored-by: dorkmo <[email protected]>
1 parent 7fd57cb commit 4d1180f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TankAlarm-112025-Viewer-BluesOpta/TankAlarm-112025-Viewer-BluesOpta.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static const char VIEWER_DASHBOARD_HTML[] PROGMEM = R"HTML(
402402
}
403403
404404
function formatFeetInches(inches) {
405-
if (typeof inches !== 'number' || !isFinite(inches)) return '--';
405+
if (typeof inches !== 'number' || !isFinite(inches) || inches < 0) return '--';
406406
const feet = Math.floor(inches / 12);
407407
const remainingInches = inches % 12;
408408
return `${feet}' ${remainingInches.toFixed(1)}"`;

0 commit comments

Comments
 (0)