From dbe86340415db62191205e6762f24f739b2b6a93 Mon Sep 17 00:00:00 2001 From: Joe Knapper Date: Tue, 24 Feb 2026 12:36:30 +0000 Subject: [PATCH] Apply suggestions from code review of branch allow-zero Co-authored-by: Julian Stirling --- webapp/src/components/labThingsComponents/inputFromSchema.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/components/labThingsComponents/inputFromSchema.vue b/webapp/src/components/labThingsComponents/inputFromSchema.vue index 6caac19e..891075ea 100644 --- a/webapp/src/components/labThingsComponents/inputFromSchema.vue +++ b/webapp/src/components/labThingsComponents/inputFromSchema.vue @@ -347,7 +347,7 @@ export default { // Rounding to about 5 sig figs to stop weird javascript rounding. const absVal = Math.abs(newValue); - const magnitude = absVal > 0 ? Math.floor(Math.log10(absVal)) : 0; + const magnitude = absVal > Number.EPSILON ? Math.floor(Math.log10(absVal)) : 0; const factor = 10 ** -(Math.floor(magnitude) - 4); this.internalValue = Math.round(newValue * factor) / factor; },