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; },