mirror of
https://github.com/mempool/mempool.git
synced 2025-01-19 14:45:28 +01:00
Merge pull request #1445 from mempool/nymkappa/bugfix/avg-fee-rounding
Fix rounding issue in reward stats
This commit is contained in:
commit
fcaa6100b7
@ -17,7 +17,7 @@
|
||||
<div class="card-text" i18n-ngbTooltip="Transaction fee tooltip"
|
||||
ngbTooltip="Average miners' reward per transaction in the past 144 blocks" placement="bottom">
|
||||
<div class="fee-text">
|
||||
{{ rewardStats.rewardPerTx | amountShortener }}
|
||||
{{ rewardStats.rewardPerTx | amountShortener: 2 }}
|
||||
<span i18n="shared.sat-vbyte|sat/vB">sats/tx</span>
|
||||
</div>
|
||||
<span class="fiat">
|
||||
@ -29,7 +29,7 @@
|
||||
<h5 class="card-title" i18n="mining.average-fee">Average Fee</h5>
|
||||
<div class="card-text" i18n-ngbTooltip="Transaction fee tooltip"
|
||||
ngbTooltip="Fee paid on average for each transaction in the past 144 blocks" placement="bottom">
|
||||
<div class="fee-text">{{ rewardStats.feePerTx | amountShortener }}
|
||||
<div class="fee-text">{{ rewardStats.feePerTx | amountShortener: 2 }}
|
||||
<span i18n="shared.sat-vbyte|sat/vB">sats/tx</span>
|
||||
</div>
|
||||
<span class="fiat">
|
||||
|
@ -5,11 +5,12 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||
})
|
||||
export class AmountShortenerPipe implements PipeTransform {
|
||||
transform(num: number, ...args: number[]): unknown {
|
||||
const digits = args[0] || 1;
|
||||
|
||||
if (num < 1000) {
|
||||
return num;
|
||||
return num.toFixed(digits);
|
||||
}
|
||||
|
||||
const digits = args[0] || 1;
|
||||
const lookup = [
|
||||
{ value: 1, symbol: '' },
|
||||
{ value: 1e3, symbol: 'k' },
|
||||
|
Loading…
Reference in New Issue
Block a user