]> git.seodisparate.com - mpd_info_screen/commitdiff
Minor fix/tweak to display timer output
authorStephen Seo <seo.disparate@gmail.com>
Thu, 16 Sep 2021 05:46:44 +0000 (14:46 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 16 Sep 2021 05:46:44 +0000 (14:46 +0900)
src/main.rs

index 1ed7f6527db4b5f577d4543a90980e15039f0c35..2f0e3704637b4c82f7a7f7299f863a72d4ead633 100644 (file)
@@ -418,6 +418,9 @@ fn seconds_to_time(seconds: f64) -> String {
     } else {
         result = String::new();
     }
+    if new_seconds < 10.0 {
+        result.push('0');
+    }
     result.push_str(&new_seconds.to_string());
     let idx_result = result.find('.');
     if let Some(idx) = idx_result {