question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Promotions approval percentage

See original GitHub issue

Should the calculated approval percentage for campaigns be Approved / (Approved + Abstained + Opposed) or Approved / (Approved + Opposed)? I noticed that the !promotions command includes abstains in the total, but the progress bar on the web page doesn’t. Which is the preferred method?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jmazouricommented, Apr 10, 2019

Yes, the math should be Approved / (Approved + Opposed) - abstained are not taken into account at all. The frontend is using the correct logic - see the bars on https://mod.gg/promotions for an example.

For example, a campaign with 4 upvotes, 5 neutral votes, and 1 downvote should be at 80%.

0reactions
joshuaedwardcrowecommented, Apr 10, 2019

Looking at picking this up. Current code seems to summarise as round((approved / total) * 100), are we agreed on rround((approved / ((approved + opposed) - abstained)) * 100)?

See below for evidence:

public static double GetApprovalPercentage(this PromotionCampaignSummary campaign)
{
    var totalApprovals = campaign.CommentCounts
        .Where(x => x.Key == PromotionSentiment.Approve)
        .Select(x => x.Value)
        .Sum();

    double totalVotes = GetTotalVotes(campaign);

    return totalApprovals / totalVotes;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Promotion Timing, Zones, and Opportunity
BPZ percentages may be up to 10 percent of the total recommended number of promotions, or 15 percent with SECDEF approval. Promotion zones...
Read more >
Secret to getting your promotions approved
Secret to getting your promotions approved · How to debunk the "No business need for the promotion"? · There could be a better...
Read more >
Fusion Compensation: Salary: Promotion Approval Fails ...
For the Promotion approval rule, need a rule that allows for promotions to be submitted for approval with the salary percentage null or...
Read more >
Enlisted Promotions
SUPPLEMENTAL PROMOTION CONSIDERATION · Only applicable to promotion eligible Airmen to the grades of E7, E8, and E9 who either did not meet...
Read more >
How to understand special promotional financing offers on ...
A zero percent interest promotion will not add interest based on the balance of your promotional purchase during the promotional period.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found