From f1bb742341508fcadb92bcd4278be9fee822a188 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 24 Mar 2022 18:03:12 +0900 Subject: [PATCH] Fix rounding issue in reward stats --- .../app/components/reward-stats/reward-stats.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/reward-stats/reward-stats.component.ts b/frontend/src/app/components/reward-stats/reward-stats.component.ts index dd466985e..8116f2db7 100644 --- a/frontend/src/app/components/reward-stats/reward-stats.component.ts +++ b/frontend/src/app/components/reward-stats/reward-stats.component.ts @@ -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, }; }) );