@@ -90,7 +90,7 @@ const VotingProgressChart = ({
9090 const quorumPercentage = safeNumberFromBigInt ( proposal . voting_quorum ) ;
9191 const thresholdPercentage = safeNumberFromBigInt ( proposal . voting_threshold ) ;
9292
93- // Calculate if requirements are met
93+ // Calculate if requirements are met (using exact floating point comparison)
9494 const metQuorum = calculations . participationRate >= quorumPercentage ;
9595 const metThreshold =
9696 calculations . totalVotes > 0
@@ -127,7 +127,7 @@ const VotingProgressChart = ({
127127 return "Met" ;
128128 }
129129 return percentage !== undefined
130- ? `In Progress (${ percentage . toFixed ( 1 ) } %)`
130+ ? `In Progress (${ percentage . toFixed ( 4 ) } %)`
131131 : "In Progress" ;
132132 }
133133
@@ -492,7 +492,7 @@ const VotingProgressChart = ({
492492 decimals = { 8 }
493493 variant = "abbreviated"
494494 /> { " " }
495- ({ enhancedCalculations . votesForPercent . toFixed ( 1 ) } %)
495+ ({ enhancedCalculations . votesForPercent . toFixed ( 4 ) } %)
496496 </ span >
497497 ) : (
498498 < span className = "text-destructive" > Failed to fetch</ span >
@@ -507,7 +507,7 @@ const VotingProgressChart = ({
507507 decimals = { 8 }
508508 variant = "abbreviated"
509509 /> { " " }
510- ({ enhancedCalculations . votesAgainstPercent . toFixed ( 1 ) } %)
510+ ({ enhancedCalculations . votesAgainstPercent . toFixed ( 4 ) } %)
511511 </ span >
512512 ) : (
513513 < span className = "text-destructive" > Failed to fetch</ span >
@@ -592,7 +592,7 @@ const VotingProgressChart = ({
592592 < div className = "flex items-center gap-1" >
593593 < div className = "w-2 h-2 bg-green-500 rounded-sm flex-shrink-0" />
594594 < span className = "break-words" >
595- Approval: { enhancedCalculations . approvalRate . toFixed ( 1 ) } % of votes
595+ Approval: { enhancedCalculations . approvalRate . toFixed ( 4 ) } % of votes
596596 cast
597597 </ span >
598598 </ div >
@@ -658,7 +658,7 @@ const VotingProgressChart = ({
658658 </ span >
659659 </ div >
660660 < div className = "text-xs text-muted-foreground" >
661- { enhancedCalculations . participationRate . toFixed ( 1 ) } % of{ " " }
661+ { enhancedCalculations . participationRate . toFixed ( 4 ) } % of{ " " }
662662 { enhancedCalculations . quorumPercentage } % required
663663 </ div >
664664 </ div >
@@ -715,7 +715,7 @@ const VotingProgressChart = ({
715715 </ span >
716716 </ div >
717717 < div className = "text-xs text-muted-foreground" >
718- { enhancedCalculations . approvalRate . toFixed ( 1 ) } % of{ " " }
718+ { enhancedCalculations . approvalRate . toFixed ( 4 ) } % of{ " " }
719719 { enhancedCalculations . thresholdPercentage } % required
720720 </ div >
721721 </ div >
0 commit comments