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
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}
})