From c46b3275a9db7fd8f00ab482fcd5376c36fb6db9 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 17 May 2021 15:08:44 +0200 Subject: [PATCH] allow negative frequencies in exponential display, closes #247 --- htdocs/lib/settings/ExponentialInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/lib/settings/ExponentialInput.js b/htdocs/lib/settings/ExponentialInput.js index 603651d..5f7e99f 100644 --- a/htdocs/lib/settings/ExponentialInput.js +++ b/htdocs/lib/settings/ExponentialInput.js @@ -38,7 +38,7 @@ $.fn.exponentialInput = function() { // calculate initial exponent var value = parseFloat($input.val()); if (!Number.isNaN(value)) { - $exponent.val(Math.floor(Math.log10(value) / 3) * 3); + $exponent.val(Math.floor(Math.log10(Math.abs(value)) / 3) * 3); setExponent(); } })