fix "NaN" display problem

This commit is contained in:
Jakob Ketterl 2021-04-28 22:44:33 +02:00
parent 4a77d2cc38
commit 3bc39a9ca3

View File

@ -30,7 +30,7 @@ FrequencyDisplay.prototype.getSuffix = function() {
FrequencyDisplay.prototype.setFrequency = function(freq) { FrequencyDisplay.prototype.setFrequency = function(freq) {
this.frequency = freq; this.frequency = freq;
if (Number.isNaN(this.frequency)) { if (this.frequency === 0 || Number.isNaN(this.frequency)) {
this.exponent = 0 this.exponent = 0
} else { } else {
this.exponent = Math.floor(Math.log10(this.frequency) / 3) * 3; this.exponent = Math.floor(Math.log10(this.frequency) / 3) * 3;