this.getMarkerLabel = function (range, time) {
var text;
this.getRegime(range.min, range.max);
var n = Math.max(Math.floor(Math.log(this.delta * Math.pow(10, this.beta) / this.level) * this.log10), -4) - 1;
if(n > 20) {
n = 20;
}
if(n < -20) {
n = -20;
}
if(n < 0) {
text = (new Number(-time / this.level)).toFixed(-n);
} else {
text = (new Number(-time / this.level)).toFixed(n);
}
text += " " + this.regime;
return text;
};
if(n < -20) - Condition never be true, because n is more than -3 always. See
var n = Math.max(Math.floor(Math.log(this.delta * Math.pow(10, this.beta) / this.level) * this.log10), -4) - 1
function
if(n < 0) {
text = (new Number(-time / this.level)).toFixed(-n);
} else {
text = (new Number(-time / this.level)).toFixed(n);
}
Change to text = (-time/this.level).toFixed(Math.abs[n])
"text", "n" - are not clear names. Use more intelligible
Observed:
Change to text = (-time/this.level).toFixed(Math.abs[n])
Link to trello card: https://trello.com/c/P4QjkuQJ