]> git.seodisparate.com - mpd_info_screen/commitdiff
Minor tweak to the remaining-time timer display
authorStephen Seo <seo.disparate@gmail.com>
Fri, 17 Sep 2021 06:11:22 +0000 (15:11 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 17 Sep 2021 06:11:22 +0000 (15:11 +0900)
src/main.rs

index a6c22a9260fb261ee514d59ecf8164557f42fee8..4da834d58019b9d1f24dbd95c918fc46381684f2 100644 (file)
@@ -512,12 +512,12 @@ fn seconds_to_time(seconds: f64) -> String {
     if minutes > 0 {
         result = minutes.to_string();
         result.push(':');
+        if new_seconds < 10.0 {
+            result.push('0');
+        }
     } else {
         result = String::new();
     }
-    if new_seconds < 10.0 && seconds >= 0.0 {
-        result.push('0');
-    }
     result.push_str(&new_seconds.to_string());
     let idx_result = result.find('.');
     if let Some(idx) = idx_result {