From ce73946885def62bff1e50de633b2f893a51d888 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Sun, 16 Feb 2025 12:19:46 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/gui/production.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exp_legacy/module/modules/gui/production.lua b/exp_legacy/module/modules/gui/production.lua index 1f391acf..2f23f69a 100644 --- a/exp_legacy/module/modules/gui/production.lua +++ b/exp_legacy/module/modules/gui/production.lua @@ -42,13 +42,12 @@ local function format_n(amount) -- Split into integer and fractional parts local integer_part, fractional_part = formatted:match("^(%-?%d+)%.(%d+)$") integer_part = integer_part or formatted - fractional_part = fractional_part or "00" -- Add commas to integer part integer_part = integer_part:reverse():gsub("(%d%d%d)", "%1,"):reverse() integer_part = integer_part:gsub("^,", ""):gsub("-,", "-") -- Handle numbers below 1000 without suffix -- Combine parts and add suffix - return string.format("%s.%s%s", integer_part, fractional_part, (suffix == "" and "") or (" " .. suffix)):gsub("%.?0+ %k$", " " .. suffix) + return string.format("%s.%s%s", integer_part, fractional_part or "00", (suffix == "" and "") or (" " .. suffix)):gsub("%.?0+ %k$", " " .. suffix) end --- Display group