Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Modules/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
end

-- Wipe all keys from the table and return it, or return a new table if no table
-- provided. This is useful to avoid alllocations in hot paths if a table can be reused. Using LuaJIT's `table.clear()` is another alternative to this, but this performs similarly on small tables, or tables which are often already empty.

Check warning on line 546 in src/Modules/Common.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (alllocations)
---@param tbl table?
---@return table tbl
function wipeTable(tbl)
Expand Down Expand Up @@ -810,7 +810,7 @@
local x, y, minus, integer, fraction = str:find("(-?)(%d+)(%.?%d*)")
if main.showThousandsSeparators then
rev1kSep = utf8.reverse(main.thousandsSeparator)
integer = utf8.reverse(utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1"..rev1kSep))
integer = utf8.reverse((utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1" .. rev1kSep)))
-- There will be leading separators if the number of digits are divisible by 3
-- This checks for their presence and removes them
-- Don't use patterns here because thousandsSeparator can be a pattern control character, and will crash if used
Expand All @@ -821,7 +821,7 @@
end
end
else
integer = utf8.reverse(utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1"))
integer = utf8.reverse((utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1")))
end
return colour..minus..integer..utf8.gsub(fraction, "%.", main.decimalSeparator)
end)
Expand Down
Loading