From 43f4a1bda5341aac703eb82cad245c9b60306894 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 14 Aug 2026 11:43:27 -1000 Subject: Print the language shares without the locale --- source/ui-stats.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source/ui-stats.c') diff --git a/source/ui-stats.c b/source/ui-stats.c index 58bd818..89bb05f 100644 --- a/source/ui-stats.c +++ b/source/ui-stats.c @@ -476,13 +476,17 @@ static void print_language_row(const char *label, unsigned long bytes, unsigned long total) { struct strbuf size = STRBUF_INIT; + int tenths; strbuf_humanise_bytes(&size, bytes); html(""); html_txt(label); html(""); html_txt(size.buf); - htmlf("%.1f%%\n", 100.0 * bytes / total); + // Printed from integers so a Lua filter switching LC_NUMERIC to a + // comma-decimal locale cannot change the output. + tenths = (int)(1000.0 * bytes / total + 0.5); + htmlf("%d.%d%%\n", tenths / 10, tenths % 10); strbuf_release(&size); } -- cgit v2.8.0