Minor tweak to the remaining-time timer display

This commit is contained in:
Stephen Seo 2021-09-17 15:11:22 +09:00
parent 1d4a6d5f35
commit cc746fa11c

View file

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