mirror of
https://github.com/mempool/mempool.git
synced 2026-08-20 13:28:00 +02:00
Display fee distribution labels to 3 sig figs
This commit is contained in:
parent
9845567c2f
commit
ffd2685922
1 changed files with 4 additions and 2 deletions
|
|
@ -135,7 +135,8 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr
|
|||
formatter: (value: number): string => {
|
||||
const unitValue = this.weightMode ? value / 4 : value;
|
||||
const selectedPowerOfTen = selectPowerOfTen(unitValue);
|
||||
const newVal = Math.round(unitValue / selectedPowerOfTen.divider);
|
||||
const scaledValue = unitValue / selectedPowerOfTen.divider;
|
||||
const newVal = scaledValue >= 100 ? Math.round(scaledValue) : scaledValue.toPrecision(3);
|
||||
return `${newVal}${selectedPowerOfTen.unit}`;
|
||||
},
|
||||
},
|
||||
|
|
@ -155,7 +156,8 @@ export class FeeDistributionGraphComponent implements OnInit, OnChanges, OnDestr
|
|||
const value = label.data[1];
|
||||
const unitValue = this.weightMode ? value / 4 : value;
|
||||
const selectedPowerOfTen = selectPowerOfTen(unitValue);
|
||||
const newVal = Math.round(unitValue / selectedPowerOfTen.divider);
|
||||
const scaledValue = unitValue / selectedPowerOfTen.divider;
|
||||
const newVal = scaledValue >= 100 ? Math.round(scaledValue) : scaledValue.toPrecision(3);
|
||||
return `${newVal}${selectedPowerOfTen.unit}`;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue