Skip to content

Commit

Permalink
Merge pull request #12 from Logonz/master
Browse files Browse the repository at this point in the history
Changed so that the percent is shown with two decimal points.
  • Loading branch information
christophrus authored Sep 11, 2019
2 parents 904ddc2 + e263fca commit 4a6b45a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CensusPlusClassic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3123,7 +3123,7 @@ function CensusPlus_OnEnterRace(self, motion)
local raceName = thisFactionRaces[id]
local count = g_RaceCount[id]
if (count ~= nil) and (g_TotalCount > 0) then
local percent = floor((count / g_TotalCount) * 100)
local percent = string.format("%.2f", (count / g_TotalCount) * 100)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(
raceName .. "\n" .. count .. "\n" .. percent .. "%",
Expand Down Expand Up @@ -3151,7 +3151,7 @@ function CensusPlus_OnEnterClass(self, motion)
local className = thisFactionClasses[id]
local count = g_ClassCount[id]
if (count ~= nil) and (g_TotalCount > 0) then
local percent = floor((count / g_TotalCount) * 100)
local percent = string.format("%.2f", (count / g_TotalCount) * 100)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(
className .. "\n" .. count .. "\n" .. percent .. "%",
Expand All @@ -3176,7 +3176,7 @@ function CensusPlus_OnEnterLevel(self, motion )
local id = self:GetID()
local count = g_LevelCount[id]
if (count ~= nil) and (g_TotalCount > 0) then
local percent = floor((count / g_TotalCount) * 100)
local percent = string.format("%.2f", (count / g_TotalCount) * 100)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(
LEVEL .. " " .. id .. "\n" .. count .. "\n" .. percent .. "%",
Expand Down

0 comments on commit 4a6b45a

Please sign in to comment.