Skip to content

Commit

Permalink
Fix zero truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed Jul 20, 2024
1 parent 6afb0fb commit 54e069e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions RatingBuster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1975,15 +1975,15 @@ function RatingBuster:ProcessText(text, link, color)
-- Group effects with identical values
for statID, effect in pairs(infoTable) do
if type(statID) == "table" and statID.isPercent or statID == "Spell" then
effect = ("%+.2f"):format(effect):trim("[0.]") .. "%"
effect = ("%+.2f"):format(effect):gsub("(%.%d-)0+$", "%1"):trim(".") .. "%"
effects[effect] = effects[effect] or {}
tinsert(effects[effect], S[statID])
elseif statID == "Percent" then
effect = ("%+.2f"):format(effect):trim("[0.]") .. "%"
effect = ("%+.2f"):format(effect):gsub("(%.%d-)0+$", "%1"):trim(".") .. "%"
effects[effect] = effects[effect] or {}
else
if floor(abs(effect) * 10 + 0.5) > 0 then
effect = ("%+.1f"):format(effect):trim("[0.]")
effect = ("%+.1f"):format(effect):gsub("(%.%d-)0+$", "%1"):trim(".")
elseif floor(abs(effect) + 0.5) > 0 then
effect = ("%+.0f"):format(effect)
else
Expand Down

0 comments on commit 54e069e

Please sign in to comment.