Fixed calc overview of sources of increases/reductions not being formatted
This commit is contained in:
@@ -350,7 +350,7 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
|
||||
for _, row in ipairs(rowList) do
|
||||
if not sectionData.modType then
|
||||
-- No modifier type specified, so format the value to convey type
|
||||
row.displayValue = self:FormatModValue(row.value, row.mod.type)
|
||||
row.displayValue = formatInteger(self:FormatModValue(row.value, row.mod.type))
|
||||
else
|
||||
section.colList[1].right = true
|
||||
row.displayValue = formatRound(row.value, 2)
|
||||
|
||||
@@ -494,6 +494,17 @@ function formatNumSep(str)
|
||||
end)
|
||||
end
|
||||
|
||||
-- Takes either string representation of an integer or an integer and returns a formatted string
|
||||
-- "123456789" -> "1,234,567,890"
|
||||
function formatInteger(int)
|
||||
local str = tostring(int)
|
||||
if main.showThousandsSeparators then
|
||||
return str:gsub("(%d)(%d%d)","%1"..main.thousandsSeparator.."%2")
|
||||
else
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
function getFormatNumSep(dec)
|
||||
return function(val)
|
||||
return formatNumSep(val, dec)
|
||||
|
||||
Reference in New Issue
Block a user