from retail

This commit is contained in:
NoM0Re
2025-02-09 15:59:35 +01:00
parent 6ad996d52f
commit c27637908d
+30 -13
View File
@@ -123,29 +123,39 @@ Private.unit_realm_name_types = {
}
local simpleFormatters = {
--[[
AbbreviateNumbers = function(value, state)
--[[AbbreviateNumbers = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and AbbreviateNumbers(value) or value
end,
AbbreviateLargeNumbers = function(value, state)
AbbreviateLargeNumbers = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and AbbreviateLargeNumbers(Round(value)) or value
end,
]]
BreakUpLargeNumbers = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and BreakUpLargeNumbers(value) or value
end,]]
floor = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and floor(value) or value
end,
ceil = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and ceil(value) or value
end,
round = function(value)
if type(value) == "string" then value = tonumber(value) end
return (type(value) == "number") and Round(value) or value
end,
time = {
[0] = function(value)
if value > 60 then
return string.format("%i:", math.floor(value / 60)) .. string.format("%02i", value % 60)
else
return string.format("%d", value)
if type(value) == "string" then value = tonumber(value) end
if type(value) == "number" then
if value > 60 then
return string.format("%i:", math.floor(value / 60)) .. string.format("%02i", value % 60)
else
return string.format("%d", value)
end
end
end,
-- Old Blizzard
@@ -154,13 +164,20 @@ local simpleFormatters = {
-- Remove the space between the value and unit
return fmt:gsub(" ", ""):format(time)
end,
--[[ Modern Blizzard
[2] = WeakAuras.IsRetail() and function(value)
return timeFormatter:Format(value)
end,]]
-- Fixed built-in formatter
[99] = function(value)
value = ceil(value)
if value > 60 then
return string.format("%i:", math.floor(value / 60)) .. string.format("%02i", value % 60)
else
return string.format("%d", value)
if type(value) == "string" then value = tonumber(value) end
if type(value) == "number" then
value = ceil(value)
if value > 60 then
return string.format("%i:", math.floor(value / 60)) .. string.format("%02i", value % 60)
else
return string.format("%d", value)
end
end
end,
},