Fix rounding issue in reward stats
This commit is contained in:
parent
77df0c524c
commit
f1bb742341
@ -24,10 +24,11 @@ export class RewardStatsComponent implements OnInit {
|
|||||||
return this.apiService.getRewardStats$()
|
return this.apiService.getRewardStats$()
|
||||||
.pipe(
|
.pipe(
|
||||||
map((stats) => {
|
map((stats) => {
|
||||||
|
const precision = 100;
|
||||||
return {
|
return {
|
||||||
totalReward: stats.totalReward,
|
totalReward: stats.totalReward,
|
||||||
rewardPerTx: stats.totalReward / stats.totalTx,
|
rewardPerTx: Math.round((stats.totalReward / stats.totalTx) * precision) / precision,
|
||||||
feePerTx: stats.totalFee / stats.totalTx,
|
feePerTx: Math.round((stats.totalFee / stats.totalTx) * precision) / precision,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user