allow negative frequencies in exponential display, closes #247

This commit is contained in:
Jakob Ketterl 2021-05-17 15:08:44 +02:00
parent 0258a75650
commit c46b3275a9

View File

@ -38,7 +38,7 @@ $.fn.exponentialInput = function() {
// calculate initial exponent // calculate initial exponent
var value = parseFloat($input.val()); var value = parseFloat($input.val());
if (!Number.isNaN(value)) { 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(); setExponent();
} }
}) })