mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 14:50:52 +01:00
Fix rounding issue in reward stats
This commit is contained in:
parent
77df0c524c
commit
f1bb742341
1 changed files with 3 additions and 2 deletions
|
@ -24,10 +24,11 @@ export class RewardStatsComponent implements OnInit {
|
|||
return this.apiService.getRewardStats$()
|
||||
.pipe(
|
||||
map((stats) => {
|
||||
const precision = 100;
|
||||
return {
|
||||
totalReward: stats.totalReward,
|
||||
rewardPerTx: stats.totalReward / stats.totalTx,
|
||||
feePerTx: stats.totalFee / stats.totalTx,
|
||||
rewardPerTx: Math.round((stats.totalReward / stats.totalTx) * precision) / precision,
|
||||
feePerTx: Math.round((stats.totalFee / stats.totalTx) * precision) / precision,
|
||||
};
|
||||
})
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue