Skip to content

Commit

Permalink
Changed so that the percent is show with two decimal points.
Browse files Browse the repository at this point in the history
  • Loading branch information
Logonz committed Sep 4, 2019
1 parent 3b0de85 commit e263fca
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 e263fca

Please sign in to comment.