fix "NaN" display problem
This commit is contained in:
parent
4a77d2cc38
commit
3bc39a9ca3
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user