- return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, hundredths ? 2 : 1));
+ if (!compact || minutes > 0)
+ return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, hundredths ? 2 : 1));
+
+ int ofs = 2, digits = 1;
+ if (tm_without_minutes >= 10 * (hundredths ? 100 : 10))
+ {
+ ofs = 1;
+ digits = 2;
+ }
+ return strcat(substring(s, ofs, digits), ".", substring(s, 3, hundredths ? 2 : 1));
+