@@ -11,6 +11,7 @@ import BalanceIcon from "svgs/icons/law-balance.svg";
11
11
import { KLEROS_CONTRACT_ADDRESS , WETH_CONTRACT_ADDRESS } from "src/consts/index" ;
12
12
import { commify } from "utils/commify" ;
13
13
import { isUndefined } from "utils/index" ;
14
+ import { roundDecimals } from "utils/roundDecimals" ;
14
15
import { useHomePageContext , HomePageQuery , HomePageQueryDataPoints } from "hooks/useHomePageContext" ;
15
16
import { useCoinPrice } from "hooks/useCoinPrice" ;
16
17
@@ -39,7 +40,7 @@ const stats: IStat[] = [
39
40
{
40
41
title : "PNK staked" ,
41
42
coinId : 0 ,
42
- getText : ( counters ) => commify ( formatUnits ( getLastOrZero ( counters , "stakedPNK" ) , 18 ) ) ,
43
+ getText : ( counters ) => commify ( roundDecimals ( formatUnits ( getLastOrZero ( counters , "stakedPNK" ) , 18 ) , 0 ) ) ,
43
44
getSubtext : ( counters , coinPrice ) =>
44
45
( parseInt ( formatUnits ( getLastOrZero ( counters , "stakedPNK" ) , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
45
46
color : "purple" ,
@@ -48,7 +49,7 @@ const stats: IStat[] = [
48
49
{
49
50
title : "ETH Paid to jurors" ,
50
51
coinId : 1 ,
51
- getText : ( counters ) => commify ( formatEther ( getLastOrZero ( counters , "paidETH" ) ) ) ,
52
+ getText : ( counters ) => commify ( roundDecimals ( formatEther ( getLastOrZero ( counters , "paidETH" ) ) , 4 ) ) ,
52
53
getSubtext : ( counters , coinPrice ) =>
53
54
( Number ( formatUnits ( getLastOrZero ( counters , "paidETH" ) , 18 ) ) * ( coinPrice ?? 0 ) ) . toFixed ( 2 ) . toString ( ) + "$" ,
54
55
color : "blue" ,
@@ -57,7 +58,7 @@ const stats: IStat[] = [
57
58
{
58
59
title : "PNK redistributed" ,
59
60
coinId : 0 ,
60
- getText : ( counters ) => commify ( formatUnits ( getLastOrZero ( counters , "redistributedPNK" ) , 18 ) ) ,
61
+ getText : ( counters ) => commify ( roundDecimals ( formatUnits ( getLastOrZero ( counters , "redistributedPNK" ) , 18 ) , 0 ) ) ,
61
62
getSubtext : ( counters , coinPrice ) =>
62
63
( parseInt ( formatUnits ( getLastOrZero ( counters , "redistributedPNK" ) , 18 ) ) * ( coinPrice ?? 0 ) )
63
64
. toFixed ( 2 )
0 commit comments