fix empty input
This commit is contained in:
parent
71acad3b4f
commit
e787336fc4
@ -30,7 +30,10 @@ $.fn.frequencyInput = function() {
|
|||||||
$exponent.on('change', setExponent);
|
$exponent.on('change', setExponent);
|
||||||
|
|
||||||
// calculate initial exponent
|
// calculate initial exponent
|
||||||
$exponent.val(Math.floor(Math.log10($input.val()) / 3) * 3);
|
var value = parseFloat($input.val());
|
||||||
|
if (!Number.isNaN(value)) {
|
||||||
|
$exponent.val(Math.floor(Math.log10(value) / 3) * 3);
|
||||||
setExponent();
|
setExponent();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user