From 54e069ef54787a57d72ab8289b79f789eba263c1 Mon Sep 17 00:00:00 2001 From: Casey Raethke Date: Sat, 20 Jul 2024 10:55:18 -0500 Subject: [PATCH] Fix zero truncation --- RatingBuster.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RatingBuster.lua b/RatingBuster.lua index f561a2e..bd0f595 100644 --- a/RatingBuster.lua +++ b/RatingBuster.lua @@ -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