Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/proposals/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function ProposalCard({
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);

// Calculate if requirements are met
// Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
Expand All @@ -125,7 +125,7 @@ export default function ProposalCard({
}

if (isActive) {
return percentage !== undefined ? `${percentage.toFixed(1)}%` : "0%";
return percentage !== undefined ? `${percentage.toFixed(4)}%` : "0%";
}

return met ? "Passed" : "Failed";
Expand Down
4 changes: 2 additions & 2 deletions src/components/proposals/ProposalHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function ProposalHeader({ proposal }: ProposalHeaderProps) {
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);

// Calculate if requirements are met
// Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
Expand All @@ -70,7 +70,7 @@ export function ProposalHeader({ proposal }: ProposalHeaderProps) {
// Helper function to get status text
const getStatusText = (isMet: boolean, percentage: number) => {
if (isMet) return "Passed";
return `${percentage.toFixed(1)}%`;
return `${percentage.toFixed(4)}%`;
};

// Get DAO/token image - prioritize token image, fallback to DAO image if available
Expand Down
4 changes: 2 additions & 2 deletions src/components/proposals/VotesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const VotesTable = ({ proposalId, limit }: VotesTableProps) => {
return (
<Badge variant="secondary" className="text-xs">
{typeof finalScore === "number"
? finalScore.toFixed(1)
? finalScore.toFixed(4)
: String(finalScore)}
</Badge>
);
Expand All @@ -82,7 +82,7 @@ const VotesTable = ({ proposalId, limit }: VotesTableProps) => {
return (
<Badge variant="secondary" className="text-xs">
{typeof parsedScore === "number"
? parsedScore.toFixed(1)
? parsedScore.toFixed(4)
: String(parsedScore)}
</Badge>
);
Expand Down
14 changes: 7 additions & 7 deletions src/components/proposals/VotingProgressChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const VotingProgressChart = ({
const quorumPercentage = safeNumberFromBigInt(proposal.voting_quorum);
const thresholdPercentage = safeNumberFromBigInt(proposal.voting_threshold);

// Calculate if requirements are met
// Calculate if requirements are met (using exact floating point comparison)
const metQuorum = calculations.participationRate >= quorumPercentage;
const metThreshold =
calculations.totalVotes > 0
Expand Down Expand Up @@ -127,7 +127,7 @@ const VotingProgressChart = ({
return "Met";
}
return percentage !== undefined
? `In Progress (${percentage.toFixed(1)}%)`
? `In Progress (${percentage.toFixed(4)}%)`
: "In Progress";
}

Expand Down Expand Up @@ -492,7 +492,7 @@ const VotingProgressChart = ({
decimals={8}
variant="abbreviated"
/>{" "}
({enhancedCalculations.votesForPercent.toFixed(1)}%)
({enhancedCalculations.votesForPercent.toFixed(4)}%)
</span>
) : (
<span className="text-destructive">Failed to fetch</span>
Expand All @@ -507,7 +507,7 @@ const VotingProgressChart = ({
decimals={8}
variant="abbreviated"
/>{" "}
({enhancedCalculations.votesAgainstPercent.toFixed(1)}%)
({enhancedCalculations.votesAgainstPercent.toFixed(4)}%)
</span>
) : (
<span className="text-destructive">Failed to fetch</span>
Expand Down Expand Up @@ -592,7 +592,7 @@ const VotingProgressChart = ({
<div className="flex items-center gap-1">
<div className="w-2 h-2 bg-green-500 rounded-sm flex-shrink-0" />
<span className="break-words">
Approval: {enhancedCalculations.approvalRate.toFixed(1)}% of votes
Approval: {enhancedCalculations.approvalRate.toFixed(4)}% of votes
cast
</span>
</div>
Expand Down Expand Up @@ -658,7 +658,7 @@ const VotingProgressChart = ({
</span>
</div>
<div className="text-xs text-muted-foreground">
{enhancedCalculations.participationRate.toFixed(1)}% of{" "}
{enhancedCalculations.participationRate.toFixed(4)}% of{" "}
{enhancedCalculations.quorumPercentage}% required
</div>
</div>
Expand Down Expand Up @@ -715,7 +715,7 @@ const VotingProgressChart = ({
</span>
</div>
<div className="text-xs text-muted-foreground">
{enhancedCalculations.approvalRate.toFixed(1)}% of{" "}
{enhancedCalculations.approvalRate.toFixed(4)}% of{" "}
{enhancedCalculations.thresholdPercentage}% required
</div>
</div>
Expand Down