From 1ec8d10b8816a00f9800fa7ef231d844ede6811a Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 10 Jan 2021 22:39:34 +0100 Subject: [PATCH] Small improvement --- init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 81e9d07..4616319 100644 --- a/init.lua +++ b/init.lua @@ -1858,9 +1858,10 @@ local function get_inventory_mode(player, fs, data, full_height) yextra = yextra + 3.5 end - add_subtitle(fs, sprintf("%s: %u of %u (%.1f%%)", ES"Achievements", - awards_unlocked, award_list_nb, (awards_unlocked * 100) / award_list_nb), - yextra, "+2") + local percent = sprintf("%.1f%%", (awards_unlocked * 100) / award_list_nb):gsub(".0", "") + + add_subtitle(fs, sprintf("%s: %u of %u (%s)", ES"Achievements", + awards_unlocked, award_list_nb, percent), yextra, "+2") for i, award in ipairs(award_list) do local y = yextra - 0.7 + i + (i * 0.3)