From a6f73bc32f05b1bc211f1092666bbd726b6ba7c2 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 26 Apr 2022 17:31:31 +0200 Subject: [PATCH] Rename the seconds variable as it doesn't contain number of seconds --- qcsrc/lib/string.qh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qcsrc/lib/string.qh b/qcsrc/lib/string.qh index 79ba56ebe..6a37d5edd 100644 --- a/qcsrc/lib/string.qh +++ b/qcsrc/lib/string.qh @@ -146,11 +146,11 @@ string clockedtime_tostring(int tm, bool hundredths) if (tm < 0) return strcat("0:00:0", hundredths ? "0" : ""); int acc = hundredths ? 6000 : 600; - int seconds = floor(tm + 0.5); - int minutes = floor(seconds / acc); - seconds -= minutes * acc; + tm = floor(tm + 0.5); + int minutes = floor(tm / acc); + int tm_without_minutes = tm - minutes * acc; // NOTE: the start digit of s is a placeholder and won't be displayed - string s = ftos(acc * 10 + seconds); + string s = ftos(acc * 10 + tm_without_minutes); return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, hundredths ? 2 : 1)); } -- 2.39.2