fix "NaN" display problem

This commit is contained in:
Jakob Ketterl 2021-04-28 22:44:33 +02:00
parent 4a77d2cc38
commit 3bc39a9ca3
1 changed files with 1 additions and 1 deletions

View File

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