Skip to content

Commit

Permalink
home fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Mirgaleev committed Jul 30, 2022
1 parent 69be5df commit 3a2fdcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tzkt.Api/Services/Home/HomeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +535,15 @@ async Task<GovernanceData> GetGovernanceData()

if (period.Kind is PeriodKinds.Exploration or PeriodKinds.Promotion)
{
var yayNaySum = (int)period.YayVotingPower! + (int)period.NayVotingPower!;
var totalVoted = yayNaySum + (int)period.PassVotingPower!;
var yayNaySum = (long)period.YayVotingPower! + (long)period.NayVotingPower!;
var totalVoted = yayNaySum + (long)period.PassVotingPower!;

result.YayVotes = yayNaySum > 0
? Math.Round(100.0 * (int)period.YayVotingPower / yayNaySum, 2)
? Math.Round(100.0 * (long)period.YayVotingPower / yayNaySum, 2)
: 0;

result.Participation = period.TotalVotingPower > 0
? Math.Round(100.0 * totalVoted / (int)period.TotalVotingPower, 2)
? Math.Round(100.0 * totalVoted / (long)period.TotalVotingPower, 2)
: 0;

result.BallotsQuorum = Math.Round((double)period.BallotsQuorum!, 2);
Expand Down

0 comments on commit 3a2fdcb

Please sign in to comment.