Merge pull request #4466 from ncois/pool-hashrate-format
Pool chart hashrate format in power of ten
This commit is contained in:
@@ -249,8 +249,8 @@ export class HashrateChartComponent implements OnInit {
|
||||
for (const tick of ticks) {
|
||||
if (tick.seriesIndex === 0) { // Hashrate
|
||||
let hashrate = tick.data[1];
|
||||
hashratePowerOfTen = selectPowerOfTen(tick.data[1]);
|
||||
hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider);
|
||||
hashratePowerOfTen = selectPowerOfTen(tick.data[1], 10);
|
||||
hashrate = tick.data[1] / hashratePowerOfTen.divider;
|
||||
hashrateString = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s<br>`;
|
||||
} else if (tick.seriesIndex === 1) { // Difficulty
|
||||
let difficultyPowerOfTen = hashratePowerOfTen;
|
||||
@@ -264,8 +264,8 @@ export class HashrateChartComponent implements OnInit {
|
||||
}
|
||||
} else if (tick.seriesIndex === 2) { // Hashrate MA
|
||||
let hashrate = tick.data[1];
|
||||
hashratePowerOfTen = selectPowerOfTen(tick.data[1]);
|
||||
hashrate = Math.round(tick.data[1] / hashratePowerOfTen.divider);
|
||||
hashratePowerOfTen = selectPowerOfTen(tick.data[1], 10);
|
||||
hashrate = tick.data[1] / hashratePowerOfTen.divider;
|
||||
hashrateStringMA = `${tick.marker} ${tick.seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,10 +163,8 @@ export class PoolComponent implements OnInit {
|
||||
let hashratePowerOfTen: any = selectPowerOfTen(1);
|
||||
let hashrate = ticks[0].data[1];
|
||||
|
||||
if (this.isMobile()) {
|
||||
hashratePowerOfTen = selectPowerOfTen(ticks[0].data[1]);
|
||||
hashrate = Math.round(ticks[0].data[1] / hashratePowerOfTen.divider);
|
||||
}
|
||||
hashratePowerOfTen = selectPowerOfTen(ticks[0].data[1], 10);
|
||||
hashrate = ticks[0].data[1] / hashratePowerOfTen.divider;
|
||||
|
||||
return `
|
||||
<b style="color: white; margin-left: 18px">${ticks[0].axisValueLabel}</b><br>
|
||||
|
||||
Reference in New Issue
Block a user